mardi 29 septembre 2015

C++ String to double conversion in scientific notation

I want to convert a given string into double without converting the value into decimal, if the string is in scientific format.

That is 1.23e1 should be saved as 1.23e1 and not as 12.3.

I checked stringstream, strtod, boost::lexical_cast and other methods but all of these convert 1.23e1 into 12.3.

Is there a way that so that 1.23e1 can be saved as 1.23e1 instead of 12.3??

Aucun commentaire:

Enregistrer un commentaire