Click to See Complete Forum and Search --> : Converting to Decimal Question


mchow2469
July 12th, 2005, 12:04 PM
Hi Guys,

I have a quick question on converting a char to decimal. Right now, I am reading chars from a file and want to convert the char to their decimal value.
For example,

Read in 2.10000E-8, then convert that to its decimal value.

When I read in the number , can I simply just say number.toDecimal?
Or I have to manually tell the program that when it scans the E or exponent, I have to multiply the value by how ever many number of 0's the exponent tells.

RatmilT
July 12th, 2005, 12:26 PM
Convert.ToInt32(str) to convert to an int.
For a float I don't know but it has to be something like that.

Jinto
July 14th, 2005, 07:59 PM
Convert::ToSingle( ) Converts to a float.