Hi John,
1.0000f is displayed as 1, and 1.3500 f is displayed as 1.35 (or rather
1,35 on my computer), using a regular ToString().
You can format the output in a number of ways, but empty zeroes will be
stripped by default, unless you specify them in a format.
Some formatting samples
http://blog.stevex.net/index.php/str...ing-in-csharp/
On Tue, 05 Sep 2006 20:59:24 +0200, John <so*****@microsoft.comwrote:
Hi,
I have varaiables declared as float, the result of .ToString() is like
1.0000. How can I get rid of the 0s in the decimal? e.g. 1.0000 will
be 1
and 1.3500 will be 1.35
TIA
--
Happy Coding!
Morten Wennevik [C# MVP]