| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Converting to Decimal Question
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. |
|
#2
|
||||
|
||||
|
Re: Converting to Decimal Question
Convert.ToInt32(str) to convert to an int.
For a float I don't know but it has to be something like that. Last edited by RatmilT; July 12th, 2005 at 12:29 PM. |
|
#3
|
||||
|
||||
|
Re: Converting to Decimal Question
Convert::ToSingle( ) Converts to a float.
__________________
"Lose it? It means go crazy...nuts...insane...bonzo...no longer in possession of one's faculties...3 fries short of a happy meal...WACKO!!!" |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|