Format without decimal values if value is 25.0

How can I format a double value (25.0) to 25 and 25.1 to 25.1
If I use Format(MyValue, “#.#”, I get 25. and 25.1

Use ToString.

s = d.ToString( "###,##0.#" )
1 Like