I was wondering if there were any built in functions for rounding to the specified decimal place of a floating point value?
I understand the round and trunc now, but these only seem to operate to the whole number.
I know I will probably have to create my own function, but did not want to reinvent the wheel. Also this might be something that could be added to the built-in round function, like passing the decimal place argument before the value.
If it doesn't exist I will create a feature request, as I believe I will be needing this quite a bit.
Example: round(4,value) rounds the number to the 4th decimal place.
-S
FastScript - Rounding to specified decimal place
Ugly method: format the number as a string with the appropriate DP flags and then convert back.
Common method: multiply the input value by 10^DP, round/trunc/ceil it, then divide it by 10^DP again.
Common method: multiply the input value by 10^DP, round/trunc/ceil it, then divide it by 10^DP again.
Who is online
Users browsing this forum: No registered users and 46 guests
