"how to convert a string representing decimal number in exponential form to float in qt?" Code Answer
4
tofloat() should work. check that your string contains only the number. if the string contains something else too, for example "144.2e-3 a", then the tofloat() returns 0. note that also other numbers in the string will cause the conversion to fail, for example qstring("144.2e-3 100").tofloat() will return 0.
additional whitespace in the number string doesn't matter, but other characters do.
tofloat() should work. check that your string contains only the number. if the string contains something else too, for example
"144.2e-3 a"
, then the tofloat() returns 0. note that also other numbers in the string will cause the conversion to fail, for exampleqstring("144.2e-3 100").tofloat()
will return 0.additional whitespace in the number string doesn't matter, but other characters do.