diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-19 14:52:19 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-23 14:13:42 +0000 |
commit | 15b5b3b3f01e400e46fe67babe593ede373dac4b (patch) | |
tree | 823f6a27092b9647dbe1f4a9004c99e9975e71c7 /src/corelib/tools/qlocale.qdoc | |
parent | 726fed0d67013cbfac7921d3d4613ca83406fb0f (diff) |
Add flags to omit/reject padding in scientific notation exponents
The EcmaScript format for printing doubles in exponent form differs
from Qt's format only in this aspect. EcmaScript explicitly prohibits
leading zeroes in exponents. It is thus worthwhile to add those flags
in order to be able to generate and parse doubles in compliance with
EcmaScript.
[ChangeLog][QtCore][QLocale] Additional flags in QLocale::NumberOption
allow generating and parsing doubles in EcmaScript compliant format.
Change-Id: Ia7b82c2e67bb8b80bd890014ff5cd4563faf2a03
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools/qlocale.qdoc')
-rw-r--r-- | src/corelib/tools/qlocale.qdoc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index 03095d88d2..76195ab666 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -930,12 +930,22 @@ conversions. They can be retrieved with numberOptions() and set with setNumberOptions(). + \value DefaultNumberOptions This option represents the default behavior, with + group separators and with one leading zero in single digit exponents. \value OmitGroupSeparator If this option is set, the number-to-string functions will not insert group separators in their return values. The default is to insert group separators. \value RejectGroupSeparator If this option is set, the string-to-number functions will fail if they encounter group separators in their input. The default is to accept numbers containing correctly placed group separators. + \value OmitLeadingZeroInExponent If this option is set, the number-to-string + functions will not pad exponents with zeroes when printing floating point + numbers in scientific notation. The default is to add one leading zero to + single digit exponents. + \value RejectLeadingZeroInExponent If this option is set, the string-to-number + functions will fail if they encounter an exponent padded with zeroes when + parsing a floating point number in scientific notation. The default is to + accept such padding. \sa setNumberOptions(), numberOptions() */ |