summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-08-28 17:06:04 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-11-24 11:49:47 +0000
commitb19036ad56896496cad4d679d44032c031c4010b (patch)
tree29db876a6aa7098e42a5a5f5e2f1fc76f6799b46
parentfbca13949a28cc3e815b829d814514ab78be6ce1 (diff)
improve QLocale::formattedDataSize docs slightly
Change-Id: I42aaec6d54299d906bf8e2ef1fd696f121b7c2d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/corelib/tools/qlocale.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 723e63114d..07bc1f8275 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3805,17 +3805,18 @@ QString QLocale::toCurrencyString(double value, const QString &symbol, int preci
/*!
\since 5.10
- Converts a size in bytes to a human-readable localized string, expressed in
- a unit for which the numeric portion is at least 1 but as low as
- possible. For example if \a bytes is 16384, \a precision is 2, and \a format
- is \c DataSizeIecFormat (the default), this function returns "16.00 KiB";
- for 1330409069609 bytes it returns "1.21 GiB"; and so on. If \a format is \c
- DataSizeIecFormat or \c DataSizeTraditionalFormat, the given number of bytes
- is divided by a power of 1024, with result less than 1024; for \c
- DataSizeSIFormat, it is divided by a power of 1000, with result less than
- 1000. DataSizeIecFormat uses the new IEC standard quantifiers Ki, Mi and so
- on, whereas DataSizeSIFormat uses and DataSizeTraditionalFormat abuses the
- older SI quantifiers k, M, etc.
+ Converts a size in bytes to a human-readable localized string, comprising a
+ number and a quantified unit. The quantifier is chosen such that the number
+ is at least one, and as small as possible. For example if \a bytes is
+ 16384, \a precision is 2, and \a format is \l DataSizeIecFormat (the
+ default), this function returns "16.00 KiB"; for 1330409069609 bytes it
+ returns "1.21 GiB"; and so on. If \a format is \l DataSizeIecFormat or
+ \l DataSizeTraditionalFormat, the given number of bytes is divided by a
+ power of 1024, with result less than 1024; for \l DataSizeSIFormat, it is
+ divided by a power of 1000, with result less than 1000.
+ \c DataSizeIecFormat uses the new IEC standard quantifiers Ki, Mi and so on,
+ whereas \c DataSizeSIFormat uses the older SI quantifiers k, M, etc., and
+ \c DataSizeTraditionalFormat abuses them.
*/
QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats format)
{