I have some fields returned by a collection as
2.4200 2.0044 2.0000
I want results like
2.42 2.0044 2
I t
Very simple answer is to use TrimEnd(). Here is the result,
double value = 1.00; string output = value.ToString().TrimEnd('0');
Output is 1 If my value is 1.01 then my output will be 1.01