To remove the Tailing zero after decimal

Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  

use the string format to remove the tailing zeros after decimal.

For this use
item.ToString(“G69”);

It will remove all the zero followed by decimal.

example Output:

0.400     –>  0.4

4.00       –> 4

4.0300  –> 4.03

4             –> 4


Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.