c# - Decimal to string conversion issues -



c# - Decimal to string conversion issues -

possible duplicate: c# how remove 0 end of decimal value best way display decimal without trailing zeros in c#

i have decimal variable has value

2.50 2.25

how can convert string can get

2.5 2.25

issue 2.50 must 2.5 in string.

string.format("{0:0.##}", 2.50);

you can convert string , string.trim('0'); trim trailing zeros off.

c# decimal

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -