Floating point rounding ?
Bits
Posts: 414
Is there an object out there that will take a floating point number and round it as follows:
example numbers
1. 25.3600 to 25.3633
2. 25.3634 to 25.3666
3. 25.3667 to 25.3699
and the functions should crank out
1. 25.3600
2. 25.3633
3. 25.3666
example numbers
1. 25.3600 to 25.3633
2. 25.3634 to 25.3666
3. 25.3667 to 25.3699
and the functions should crank out
1. 25.3600
2. 25.3633
3. 25.3666
Comments
On a higher level what is it you actually want to do with this and/or why? Perhaps there is a better way.
A general method is to multiply the number by 1.5, round it in the normal way, then divide it by 1.5.
In your example multiply by 150, round, then divide by 150.
Duane