This example formats double to string with fixed number of decimal places. For two decimal places use pattern „0.00“. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.
Ex :-.ToString("N"); // 98.5864256544 ==> 98.58orString.Format("{0:0.00}", 123.4567); // "123.46"
 
 
No comments:
Post a Comment