diff --git a/packages/core/database/src/__tests__/value-parsers/number.test.ts b/packages/core/database/src/__tests__/value-parsers/number.test.ts index 7498a0607..1c13a28e2 100644 --- a/packages/core/database/src/__tests__/value-parsers/number.test.ts +++ b/packages/core/database/src/__tests__/value-parsers/number.test.ts @@ -22,6 +22,12 @@ describe('number value parser', () => { expect(parser.errors.length === 0).toBeTruthy(); expectValue('22.5507%').toBe(0.225507); expect(parser.errors.length === 0).toBeTruthy(); + expectValue('2,122,121,122').toBe(2122121122); + expect(parser.errors.length === 0).toBeTruthy(); + expectValue('2,122,121,122.5507').toBe(2122121122.5507); + expect(parser.errors.length === 0).toBeTruthy(); + expectValue('11,122.5507%').toBe(111.225507); + expect(parser.errors.length === 0).toBeTruthy(); }); it('should be null', () => { diff --git a/packages/core/database/src/value-parsers/number-value-parser.ts b/packages/core/database/src/value-parsers/number-value-parser.ts index a82268b2d..c12f02e3f 100644 --- a/packages/core/database/src/value-parsers/number-value-parser.ts +++ b/packages/core/database/src/value-parsers/number-value-parser.ts @@ -11,6 +11,7 @@ export class NumberValueParser extends BaseValueParser { } else if (['n/a', '-'].includes(value.toLowerCase())) { this.value = null; } else { + value = value.replace(/,/g, ''); if (value.endsWith('%')) { value = percent2float(value); } else {