Skip to content

Commit

Permalink
Merge pull request #217 from capitec/hot-fix-improve-currency-field-b…
Browse files Browse the repository at this point in the history
…ackward-compatibility

Hotfix - Update omni-currency-field logic to support backward compatible browsers
  • Loading branch information
stefan505 authored Nov 27, 2023
2 parents 18fc558 + c72f8ae commit 9084995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/currency-field/CurrencyField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class CurrencyField extends OmniFormElement {

// Convert given value to cents.
_convertToCents(currencyValue: string) {
return currencyValue.replace(this.fractionalSeparator, '').replaceAll(this.thousandsSeparator, '');
return currencyValue.replace(this.fractionalSeparator, '').replace(new RegExp(this.thousandsSeparator, 'g'), '');
}

// Format to a full currency value with whole amount and cents.
Expand Down

0 comments on commit 9084995

Please sign in to comment.