Skip to content
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

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

attrib
Copy link

@attrib attrib commented Jul 10, 2023

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@SuiteBot
Copy link

SuiteBot commented Jul 10, 2023

CLA assistant check
All committers have signed the CLA.

@serhiisamko091184
Copy link
Contributor

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/

As an example:
image

Thanks a lot i advance!

Regards,
Serhii

@serhiisamko091184 serhiisamko091184 added the Status: Requires Updates Issues & PRs which requires input or update from the author label Jul 10, 2023
@serhiisamko091184 serhiisamko091184 added PR 4-8 Complexity Score given to PRs once assessed Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Requires Code Review Needs the core team to code review and removed Status: Requires Updates Issues & PRs which requires input or update from the author labels Jul 11, 2023
@serhiisamko091184
Copy link
Contributor

Hello @attrib ,
thanks for changes you've made to update commit message!

Regards,
Serhii

@jack7anderson7 jack7anderson7 added the Area: Workflow Issues & PRs related to all things regarding workflow label Aug 30, 2023
…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.
@attrib
Copy link
Author

attrib commented Sep 15, 2023

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.

@SinergiaCRM
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Workflow Issues & PRs related to all things regarding workflow PR 4-8 Complexity Score given to PRs once assessed Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Requires Code Review Needs the core team to code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculating decimal values in workflow fails if number format is set to NL
5 participants