Open wescleveland56 opened 3 weeks ago
As of right now number formatting uses the browser locale to perform the number internationalization vs. the passed in configuration from the renderer for translations, so this currently works as designed. I understand that your case requires them to be linked, but that is just not how it currently works. If there is a way to "force" the browser internationalization then I would just do that before the form is rendered and it should then show the numbers correctly.
Thanks for the reply Travis.
Please note that in the example, utils.formatAsCurrency
is formatting based on the browser locale while number input is formatting based on the language code passed in the options, NOT the browser locale. This is the inconsistency I am trying to raise.
Regardless of my use case, IMO, number formatting should be consistent - ALWAYS use browser's locale if that is the design approach, but NEVER use a mix of browser locale and options language code. That is, number input should use the same number format as number formatting (utils.formatAsCurrency
in this case).
Also, I do have a workaround but it is just that - a workaround - and doesn't solve the root problem.
Thanks. :)
For Internal Reference: FIO-9353
Describe the bug When a language is specified in the Options JSON, that language's locale seems to be used to format numbers in the number input control or in the currency input control but the
utils.formatAsCurrency
function doesn't follow the same behavior. Perhapsutils.formatAsCurrency
is using the browser's locale? My testing was from the US.For the currency input control the input number seems to be formatted based on the language locale even though I specify currency is USD.
Version/Branch 5.0.0-rc.91
To Reproduce Steps to reproduce the behavior:
Expected behavior The expectation is that the number input fields, currency input fields, and the
utils.formatAsCurrency
function would all format numbers the same. Maybe this isn't a reasonable expectation???Ideally, there would be a way to specify number and currency formatting locale separate from the language used for text display. I'm sure my situation is not unique. All currency on my website will be in USD (and should be entered and formatted as such) but I want to be able to display text in the user's preferred language.
BTW, I think Formio.js is an AWESOME product and hands-down the best Open Source form builder/runner out there. Thanks for this great product.