rounding



I am trying to write a rounding function. Rounding to 0.05. e.g.

I should get below results

6.125 --> 6.15
1.699 --> 1.7
1.1985 --> 1.20
0.5625 --> 0.60

Can someone have any sample for this....Plain C/C++ function will also do. I want to write more of a generic function so that it could be used from C/C++ programs so I will avoid using the C# advanced functions.

thanks

Loading