Commit c2a0294
fix: currency formatting decimal and thousands separator (#41372)
## Description
The currency input widget has formatting issues for languages that use
',' as decimal separator. Following is the explanation of the behavior &
expected
When the user sets the value using `defaultValue` or `setValue` for this
widget.
And the value is 12.33 (here . represents decimal)
Then the widget shows 12.33, but it should show 12,33 (because language
of the browser is set to portugese; "," is decimal)
When the widget shows 12.33 (here . is not decimal)
And the user focuses on the widget
Then the widget shows 1233 (because, in portugese . is not decimal)
When the widget is focused And it shows 1233
And the user clicks to defocus it
Then the currency changes to 1.233 (because, in portugese . is not
decimal)
When the value of currency widget is set to 12.33 (. is decimal)
Then the `<widgetName>.value` should always be 12.33 (. is decimal)
BECAUSE this is actually computed value
When the user inputs 12,33 (, is decimal)
Then the `<widgetName>.value` should always be 12.33 (. is decimal)
BECAUSE this is actually computed value
<img width="866" height="306" alt="Screenshot 2025-11-11 at 7 15 22 PM"
src="https://github.com/user-attachments/assets/fe9e739f-be22-42fc-8c52-e2922495239d"
/>
<img width="796" height="269" alt="Screenshot 2025-11-11 at 7 15 46 PM"
src="https://github.com/user-attachments/assets/6ebe8e3f-fa79-4b26-937b-4f58eaebdb98"
/>
<img width="826" height="228" alt="Screenshot 2025-11-11 at 7 43 00 PM"
src="https://github.com/user-attachments/assets/2c0c403b-55ed-4558-9b06-3ceadc22fd6c"
/>
<img width="848" height="262" alt="Screenshot 2025-11-12 at 3 25 26 PM"
src="https://github.com/user-attachments/assets/7fc74256-8cd4-49d9-9b50-7d3b3bc865db"
/>
Fixes
- #39583
- #21218
## Automation
/ok-to-test tags="@tag.CurrencyInput,@tag.Widget"
### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/19293503615>
> Commit: cab318c
> Workflow: `PR Automation test suite`
> Tags: `@tag.CurrencyInput,@tag.Widget`
> Spec: ``
> <hr>Wed, 12 Nov 2025 10:00:28 UTC
<!-- end of auto-generated comment: Cypress test results -->
## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Fixed currency input formatting for programmatically set values.
Currency inputs now properly display according to your browser's locale
format (e.g., comma decimal separator in Portuguese, period in English)
when initially populated.
* **Chores**
* Updated version control ignore patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: rangrik <pranav@shoja.ai>1 parent f092c5d commit c2a0294
File tree
2 files changed
+20
-1
lines changed- app/client/src/widgets/CurrencyInputWidget/widget
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
543 | 561 | | |
544 | 562 | | |
545 | 563 | | |
| |||
0 commit comments