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:
kpdev
2026-03-10 09:59:31 -07:00
committed by GitHub
parent 6e628bb751
commit 25d9f2fcce
4 changed files with 94 additions and 3 deletions
@@ -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)