diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-16 16:52:51 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-23 14:13:34 +0000 |
commit | 726fed0d67013cbfac7921d3d4613ca83406fb0f (patch) | |
tree | d8fd15a7d6416a91c150d6f2a3b0bdd98caa0d7f /src/corelib/tools/qlocale.qdoc | |
parent | 04695c7a91bf2b7372bb5de5f8e0b5d6f7278f67 (diff) |
Interpret precision == -128 as "shortest" double conversion
Also use this for converting doubles with QVariant. We generally want
exact results there, rather than adding rounding errors whenever we
convert.
[ChangeLog][QtCore][QLocale] Added special value for double conversion
precision to get shortest accurate representation.
Change-Id: I905b8a103f39adf31d24b6ce2c8a283cf271b597
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools/qlocale.qdoc')
-rw-r--r-- | src/corelib/tools/qlocale.qdoc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index c87e67cf17..03095d88d2 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -941,6 +941,23 @@ */ /*! + \enum QLocale::FloatingPointPrecisionOption + + This enum defines constants that can be given as precision to QString::number(), + QByteArray::number(), and QLocale::toString() when converting floats or doubles, + in order to express a variable number of digits as precision. + + \value FloatingPointShortest The conversion algorithm will try to find the + shortest accurate representation for the given number. "Accurate" means + that you get the exact same number back from an inverse conversion on + the generated string representation. + + \sa toString(), QString, QByteArray + + \since 5.7 +*/ + +/*! \enum QLocale::MeasurementSystem This enum defines which units are used for measurement. |