When using useNumberField, is there any way to get information about the number formatting being used? #4872
-
I'm currently POCing the
I'm wondering if react-spectrum provides access (a helper function) to the localized number formatting it ends up using in For instance, if I could tap into a function that would return the following based off the current locale:
... then I could include text like the following to further help the user: Your number can be formatted using a comma for the thousands separator and a period for the decimal separator. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The Intl.NumberFormat.formatToParts() function may be useful, where you can check the |
Beta Was this translation helpful? Give feedback.
The Intl.NumberFormat.formatToParts() function may be useful, where you can check the
type
of a part as"group"
or"decimal"
.