I'm trying to remove the trailing zeros from a decimal value taken from a database. In particular the value is stored as 800.000
but I need to display 800
, so I need to remove the zeros, I tried:
string value = "800.000";
string converted = value.ToString("G29");
I get: 800000
but should be: 800
, I checked this question and tried also different solution but I get the same result.
What I'm doing wrong?