]> sigrok.org Git - pulseview.git/commitdiff
util: Added support for more SI prefixes
authorJoel Holdsworth <redacted>
Tue, 30 Dec 2014 10:49:43 +0000 (10:49 +0000)
committerJoel Holdsworth <redacted>
Tue, 30 Dec 2014 14:24:08 +0000 (14:24 +0000)
pv/util.cpp

index 2a04aaec7d99e68fb7ef9295c6ec4e40f5476425..ff1b484899a19507c882079014dc917062c7ccf1 100644 (file)
@@ -32,9 +32,10 @@ using namespace Qt;
 namespace pv {
 namespace util {
 
 namespace pv {
 namespace util {
 
-static const QString SIPrefixes[9] =
-       {"f", "p", "n", QChar(0x03BC), "m", "", "k", "M", "G"};
-const int FirstSIPrefixPower = -15;
+static const QString SIPrefixes[17] =
+       {"y", "z", "a", "f", "p", "n", QChar(0x03BC), "m", "", "k", "M", "G",
+       "T", "P", "E", "Z", "Y"};
+const int FirstSIPrefixPower = -24;
 
 QString format_si_value(double v, QString unit, int prefix,
        unsigned int precision, bool sign)
 
 QString format_si_value(double v, QString unit, int prefix,
        unsigned int precision, bool sign)