Is there an off-the-wall function to translate "5.6e+4" to "56000"?
Thanks
Is there an off-the-wall function to translate "5.6e+4" to "56000"?
Thanks
sscanf. Use the %f type specifer. Be sure to look at the example.
I think you can also do it with a stringstream or something but I'm not sure how.
Last edited by Doodle77; 03-27-2008 at 08:24 PM.
Code:double num = 5.6e+4; std::cout << std::fixed << num << std::endl;
If thats an output of an equation you have you could also do this. I had the same problem for my program.
Change precision accordingly, the 1 would mean like 56000.0, 2 would be 56000.00 etc.Code:cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(1);
Hope this helps.