-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix calculated fields doesn't handle numeric values with non US locale #10112
base: hotfix
Are you sure you want to change the base?
Conversation
Hello, @attrib thank you for the contribution, Could you, please, update your commit message following our documentation (add number of the issue to your message): https://docs.suitecrm.com/community/contributing-code/bugs/ Thanks a lot i advance! Regards, |
Hello @attrib , Regards, |
…es with non US locale When using non US locale and using a mathematical caluclation it returns the string in the wrong number format, which on save will result in incorrect calculations. Example calc: `multiply({P0};{P1})` if P0 is 0.8 and P1 is 0.5 the calculated field will set the string `"0.4" ` to the selected field. If this is a numeric field on save it will parse the result. In german local the dot is the thousand separator, resulting the field beeing saved as 4 and not 0.4 in the database.
Rebased and changed my old solution. My old solution run into issues, if working with numbers > 9999, as it introcuded the thousand seperator, which broke my old logic. |
We have added this code (SinergiaTIC#49) but contemplating more variables because this part only includes these types of number: 'float', 'decimal', 'currency' and 'int'. We think that this have to search other possibilities of numbers, since Studio doesn't have it, if it were added with code. |
Fixes #5511
When using non US locale and using a mathematical caluclation it returns the string in the wrong number format, which on save will result in incorrect calculations.
Example calc:
multiply({P0};{P1})
if P0 is 0.8 and P1 is 0.5 the calculated field will set the string
"0.4"
to the selected field. If this is a numeric field on save it will parse the result. In german local the dot is the thousand separator, resulting the field beeing saved as 4 and not 0.4 in the database.Description
Motivation and Context
How To Test This
Types of changes
Final checklist