Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
5.9.2, 5.15.0
-
None
-
8
Description
The C standard library function atof() works like QString::toFloat for char arrays.
In contrast to QString::toFloat(), atof() ignores e.g. a trailing unit after the float representation:
"The rest of the string after the last valid character is ignored and has no effect on the behavior of this function." http://www.cplusplus.com/reference/cstdlib/atof/
It would be nice, to be able to use QString("1.2345 V").toFloat() also. Currently it returns 0.
Attachments
Issue Links
- depends on
-
QTBUG-66187 Whitespace handling in number conversion differently for QByteArray and QString
- Closed
- relates to
-
QTBUG-85580 Often-used function `qt_asciiToDouble` may read past end of buffer
- Closed
-
QTBUG-85581 QByteArray .toDouble() does not call nulTerminated()
- Closed
-
QTBUG-74286 Reimplement QLocaleData::stringTo(Uns|)LongLong() to take size of string
- Closed
-
QTBUG-79902 QLocale: make fuller and more faithful use of the CLDR data
- Open
-
QTBUG-35543 QString.toDouble(bool ok) Documentation enhancement
- Closed