Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Formatting floating point numbers

0 views
Skip to first unread message

Marco

unread,
Jun 13, 2002, 4:39:06 AM6/13/02
to
Hello all,
I'm trying to create a string from a float with a specific format.
In particular I wanna a float with only the first to decimals. To this
goal I use an overload of the ToString method of class float that take
as parameter an object of a class that implements the IFormatProvider
Interface. So I use the class NumberFormatInfo to specify my
formatting requirements. NumberFormatInfo class has a property called
NumberDecimalDigits that I set to 2 before to pass the object to the
ToString method. Unfortunately this doesn't work so I'm looking for a
solution to the problem.
Can anyone out there gimme an advice?
TIA
Marco Paci

Justin Rogers

unread,
Jun 13, 2002, 4:51:15 AM6/13/02
to
Math.Round can be used to round to a given number of decimal locations.

--
Justin Rogers
DigiTec Web Consultants, LLC
digi...@hotmail.com
"Marco" <mp...@omniway.sm> wrote in message
news:c0a29cce.0206...@posting.google.com...

0 new messages