Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to round up the value till specific decimal digit in onFieldValueChange action chain.

in Sales 2 comments

Summary:

After calculating the value returns till 6-7 decimal digit. We want this to limit the decimal digit till 3-4. How to Round the calculated amount in below code snippet

Content (please ensure you mask any confidential information):

We have requirement to limit or round the result till 4 decimal places. Please give suggestions how it can be done.   

row.MarginPercent_c = (row.Margin_c / row.UnitPrice);

eg. if above expression returns result as 3.45659933% we want it as 3.4566%

Version (include the version you are using, if applicable):

23D

Code Snippet (add any code snippets that support your topic, if applicable):

    if (event?.modifiedField == "CostAmount") {

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!