diff --git a/core/app/core/src/lib/services/formatters/currency/currency-formatter.service.ts b/core/app/core/src/lib/services/formatters/currency/currency-formatter.service.ts index f4afd5cd4..d34f17789 100644 --- a/core/app/core/src/lib/services/formatters/currency/currency-formatter.service.ts +++ b/core/app/core/src/lib/services/formatters/currency/currency-formatter.service.ts @@ -64,6 +64,7 @@ export class CurrencyFormatter implements Formatter { const digitsInfo = this.getDigitsInfo(digits); let formatted: string; + value = this.replaceSeparatorsToInternalFormat(value); if (options && options.mode === 'edit') { formatted = formatNumber(Number(value), this.locale, digitsInfo); @@ -142,4 +143,8 @@ export class CurrencyFormatter implements Formatter { replaceSeparators(transformed: string): string { return this.numberFormatter.replaceSeparators(transformed); } + + replaceSeparatorsToInternalFormat(value: string): string { + return this.numberFormatter.replaceSeparatorsToInternalFormat(value); + } } diff --git a/core/app/core/src/lib/services/formatters/number/number-formatter.service.ts b/core/app/core/src/lib/services/formatters/number/number-formatter.service.ts index 622df4319..1fc132d29 100644 --- a/core/app/core/src/lib/services/formatters/number/number-formatter.service.ts +++ b/core/app/core/src/lib/services/formatters/number/number-formatter.service.ts @@ -151,6 +151,17 @@ export class NumberFormatter implements Formatter { return transformed; } + replaceSeparatorsToInternalFormat(value: string): string { + const decimalSymbol = this.getDecimalsSymbol() || '.'; + + const formattedValue = this.toInternalFormat(value); + + if (decimalSymbol !== '.' && value.includes(decimalSymbol)) { + value = formattedValue; + } + + return value; + } validateIntUserFormat(inputValue: any): boolean { const trimmedInputValue = this.formUtils.getTrimmedInputValue(inputValue);