Discussion
4
Replies
4881
Views

Toyota Motor Corporation Australia Ltd
AU
Posted: June 12, 2018
Last activity: January 4, 2022
Last activity: 4 Jan 2022 12:57 EST
How to round off the value of decimal property to certain precision point?
This can be achieved through the custom java function.
Java Code:
long factor = (long) Math.pow(10, PrecisionSize);
Value = Value * factor;
long tmp = Math.round(Value);
return (double) tmp / factor;
Value and PrecisionSize are the parameters for this function.