Formatting with locals #6322
Replies: 3 comments
-
@ColinKerr, any ideas? |
Beta Was this translation helpful? Give feedback.
-
Format definitions can include decimal and thousands separators. The docs cover this (scroll down): https://www.itwinjs.org/bis/ec/ec-format/ If one is not explicitly specified we pull the one from the current locale. The backend has no way to know the frontends locale when on the web so pulling from the current locale will only work in an electron app. To support this on the web we'll have to define some way for the frontend to pass back the separators to use. |
Beta Was this translation helpful? Give feedback.
-
A PR addressing this discussion has been created. The results of the investigation are posted in issue #6362 |
Beta Was this translation helpful? Give feedback.
-
We have a specific issue right now where a user tried using a , as a decimal separator as this is what is used in his local.
Specifically, he tried to input 2,75m which he expected to be 2 meters 75 cm.
The issue is that the formatter we are using (ImodelApp.quantityformatter) seems to treat "," as thousands separators and "." as decimal separators so the 2,75m he inputted behaved like it was 275m.
Now, what I'd like to know is: if there is a way to affect these values depending on the local it's being used in or what would be the best course of action in this case.
Beta Was this translation helpful? Give feedback.
All reactions