diff --git a/src/tools/roman-numeral-converter/roman-numeral-converter.service.test.ts b/src/tools/roman-numeral-converter/roman-numeral-converter.service.test.ts
index 6d64d859..5ec9dd47 100644
--- a/src/tools/roman-numeral-converter/roman-numeral-converter.service.test.ts
+++ b/src/tools/roman-numeral-converter/roman-numeral-converter.service.test.ts
@@ -13,10 +13,10 @@ describe('roman-numeral-converter', () => {
expect(arabicToRoman(0.9)).toEqual('');
});
- it('should convert numbers greater than 3999999 to empty string', () => {
- expect(arabicToRoman(3999999.1)).toEqual('');
- expect(arabicToRoman(4000000)).toEqual('');
- expect(arabicToRoman(10000000)).toEqual('');
+ it('should convert numbers greater than 3999 to empty string', () => {
+ expect(arabicToRoman(3999.1)).toEqual('');
+ expect(arabicToRoman(4000)).toEqual('');
+ expect(arabicToRoman(10000)).toEqual('');
});
it('should convert floating points number to the lower integer in roman version', () => {
@@ -70,10 +70,6 @@ describe('roman-numeral-converter', () => {
expect(arabicToRoman(999)).toEqual('CMXCIX');
expect(arabicToRoman(1000)).toEqual('M');
expect(arabicToRoman(2000)).toEqual('MM');
- expect(arabicToRoman(4000)).toEqual('IV');
- expect(arabicToRoman(5000)).toEqual('V');
- expect(arabicToRoman(9000)).toEqual('IX');
- expect(arabicToRoman(10000)).toEqual('X');
});
});
});
diff --git a/src/tools/roman-numeral-converter/roman-numeral-converter.service.ts b/src/tools/roman-numeral-converter/roman-numeral-converter.service.ts
index 64e8a516..98afec67 100644
--- a/src/tools/roman-numeral-converter/roman-numeral-converter.service.ts
+++ b/src/tools/roman-numeral-converter/roman-numeral-converter.service.ts
@@ -1,21 +1,9 @@
export const MIN_ARABIC_TO_ROMAN = 1;
-export const MAX_ARABIC_TO_ROMAN = 3999999;
+export const MAX_ARABIC_TO_ROMAN = 3999;
export function arabicToRoman(num: number) {
if (num < MIN_ARABIC_TO_ROMAN || num > MAX_ARABIC_TO_ROMAN) return '';
const lookup: { [key: string]: number } = {
- 'M': 1000000,
- 'CM': 900000,
- 'D': 500000,
- 'CD': 400000,
- 'C': 100000,
- 'XC': 90000,
- 'L': 50000,
- 'XL': 40000,
- 'X': 10000,
- 'IX': 9000,
- 'V': 5000,
- 'IV': 4000,
M: 1000,
CM: 900,
D: 500,
diff --git a/src/tools/roman-numeral-converter/roman-numeral-converter.vue b/src/tools/roman-numeral-converter/roman-numeral-converter.vue
index afe0b6bb..609b46c4 100644
--- a/src/tools/roman-numeral-converter/roman-numeral-converter.vue
+++ b/src/tools/roman-numeral-converter/roman-numeral-converter.vue
@@ -6,9 +6,11 @@