Round off decimal number 281.75 ,actual result I want 281.8

Question

Hi all, There is a distance value =281.75 but I want to round off as result =281.8.

After decimal I need only 1 digit in round off example value =281.75 and the actual result i want =281.8.

Kindly help us. I tried so many times.

281.75 result =281.8 I also tried that one also Trunc(Number) + If(Number=Trunc(Number),0,1) ,but not getting actual result it showing as result=282 only.

Also note that the Round action rounds to the nearest "even" integer in client and server actions (as per the documentation Emman linked to).

There is a MathUtils forge component that provides an additional action available for server actions Math_RoundAwayFromZero(n: decimal). Although I notice it does not specify the number of decimal digits, but that will be updated shortly.

Also note that the Round action rounds to the nearest "even" integer in client and server actions (as per the documentation Emman linked to).

There is a MathUtils forge component that provides an additional action available for server actions Math_RoundAwayFromZero(n: decimal). Although I notice it does not specify the number of decimal digits, but that will be updated shortly.

It seems like toFixed() is a better solution, but it is not! In some cases it will NOT round correctly. Also, Math.round() will NOT round correctly in some cases.

To correct the rounding problem with the previous Math.round() and toFixed(), you can define a custom JavaScript rounding function that performs a "nearly equal" test to determine whether a fractional value is sufficiently close to a midpoint value to be subject to midpoint rounding. The following function return the value of the given number rounded to the nearest integer accurately.

I would take a look at Math Utils Reactive (assuming you are building a Reactive app). It provides various rounding, flooring and truncing actions, that provide the correct mathematical way.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.

Hi all, There is a distance value =281.75 but I want to round off as result =281.8.

After decimal I need only 1 digit in round off example value =281.75 and the actual result i want =281.8.

Kindly help us. I tried so many times.

281.75

result =281.8

I also tried that one also Trunc(Number) + If(Number=Trunc(Number),0,1) ,but not getting actual result it showing as result=282 only.