diff --git a/packages/widget/src/utils/format.ts b/packages/widget/src/utils/format.ts index baddbbe7e..7ffe10639 100644 --- a/packages/widget/src/utils/format.ts +++ b/packages/widget/src/utils/format.ts @@ -68,7 +68,10 @@ export const formatAmount = ( if (!amount) { return amount; } - const formattedAmount = amount.replaceAll(',', '.'); + let formattedAmount = amount.replaceAll(',', '.'); + if (formattedAmount.startsWith('.')) { + formattedAmount = '0' + formattedAmount; + } const parsedAmount = parseFloat(formattedAmount); if (isNaN(Number(formattedAmount)) && !isNaN(parsedAmount)) { return parsedAmount.toString();