fix %r format spec
This commit is contained in:
committed by
Chris Hennes
parent
febfd65e59
commit
7b315e80a7
@@ -315,7 +315,7 @@ QString DimensionFormatter::formatValueToSpec(const double value, QString format
|
||||
else if (spec == QStringLiteral("r")) {
|
||||
// round the value to the given precision
|
||||
double rounder = dec.toDouble();
|
||||
double roundValue = std::ceil(value / rounder) * rounder;
|
||||
double roundValue = std::round(value / rounder) * rounder;
|
||||
// format the result with the same decimal count than the rounder
|
||||
int dotIndex = dec.indexOf(QStringLiteral("."));
|
||||
int nDecimals = 0;
|
||||
|
||||
Reference in New Issue
Block a user