QTextStream ts(&s);
if (sign && !v.is_zero())
ts << forcesign;
- ts << qSetRealNumberPrecision(precision) << (v * multiplier) << ' '
- << prefix << unit;
+ ts << qSetRealNumberPrecision(precision) << (v * multiplier);
+ ts << ' ' << prefix << unit;
return s;
}
exp -= 3;
}
}
+
+ const int prefix_order = -exponent(prefix);
+ precision = (prefix >= SIPrefix::none) ? max((int)(precision + prefix_order), 0) :
+ max((int)(precision - prefix_order), 0);
}
assert(prefix >= SIPrefix::yocto);