Limiting to 2 decimal places
C#
4
Posts
4
Posters
0
Views
1
Watching
-
If you're sure you'll always get d.dddd, you can simply multiply it by 100 (or the number of digits you want after the decimal point, cast it to an int and divide back by 100. Something like
double a = 1.76543;
int x = ((int)(a * 100)))/ 100.00;Regards Senthil _____________________________ My Blog | My Articles | WinMacro