How to round off the value of decimal property to certain precision point?
This can be achieved through the custom java function.
- 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.
Keep up to date on this post and subscribe to comments