Tuesday, 10 September 2013

c# how to preven double value truncation when converting to string

c# how to preven double value truncation when converting to string

Double x = 11.123456789123456;
string y = Convert.ToString(x);
//gives y=11.1234567891235
//y should be =11.123456789123456
From the above code how can I prevent the last digit(6) from being truncated

No comments:

Post a Comment