Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating point number conversion

Status
Not open for further replies.

flea333

Technical User
Sep 4, 2003
47
0
0
US
I have a string: 3.333332976326346e-004
When I use atof is returns 0.00. Is this string too long? Whats going on?
 
Are you displaying this value using the usermsg command? If you, you'll need to add the appropriate format specifier to get the format you want. For example, if I do the atof conversion and then just do a usermsg "%f" floatvar, I get 0.00. However, if I replace %f with %g, I get 0.00033. If you look at the help topic titled Formatting Text and Data, you can see the various format types that can be used when outputting data.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top