fix: respect number format in currency input (#18469)
Fixed #18355 Currency fields ignored the workspace number format when editing: display showed e.g. 5 982,77 € (French style) but the input forced US style (5,982.77) and rejected comma as decimal. Fix: CurrencyInput now uses useNumberFormat() and passes the correct thousandsSeparator and radix to the IMask input so edit mode matches the chosen format (comma/space, dot/comma, etc.). Files: CurrencyInput.tsx (use format for mask), new CurrencyInput.test.tsx . --------- Co-authored-by: root <root@dragon.second> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
+2
-1
@@ -54,7 +54,8 @@ export const CurrencyFieldInput = () => {
|
||||
amountText: string;
|
||||
currencyCode: string;
|
||||
}) => {
|
||||
const amount = parseFloat(amountText);
|
||||
const normalizedAmountText = amountText.replace(',', '.');
|
||||
const amount = parseFloat(normalizedAmountText);
|
||||
|
||||
const newCurrencyValue = {
|
||||
amountMicros: isNaN(amount)
|
||||
|
||||
Reference in New Issue
Block a user