-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFormula: support locale settings for which the decimal separator is "," #17327
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if it passes the tests should be fine.
Thank you Danilo for the fix
TString value = TString::Format("%lf", (*constIt).second); | ||
// #17225: we take into account LC_LOCALE settings for which the decimal separator | ||
// is , instead of ., e.g. de_AT.UTF-8 | ||
TString value = TString::Format("%lf", (*constIt).second).ReplaceAll(",", "."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be dependent on the value of LC_LOCALE? (in some local we might have 1,200.00
for one thousand two hundreds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a good observation. But how can we adapt to all possible locale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it seems that there are only 3 decimal separators: comma, period and arabic decimal separator (https://randombits.dev/articles/number-localization/locale-list)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking more about it... If we have an arabic decimal separator, it means that we also have arabic digits. At that point, I am unsure whether the decimal separator would be the first problem we hit...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think we need a larger conversation about local and how to handle them. It seems odds/confusion to all support local for this single functions. Until we have this conversation, I recommend we issue an explicit error when encountering a comma here.
Test Results 18 files 18 suites 4d 4h 24m 48s ⏱️ For more details on these failures, see this check. Results for commit c7a2716. ♻️ This comment has been updated with latest results. |
Fixes #17225