MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / setWithPrecision

Method setWithPrecision

tests/src/Base/SchemaTests.cpp:69–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 static std::string setWithPrecision(
70 const std::string& name,
71 const double value,
72 const Unit unit,
73 const int precision
74 )
75 {
76 UnitsApi::setSchema(name);
77 Quantity quantity {value, unit};
78 QuantityFormat format = quantity.getFormat();
79 format.setPrecision(precision);
80 quantity.setFormat(format);
81 return quantity.getSafeUserString();
82 }
83
84 static std::string setWithDenominator(
85 const std::string& name,

Callers

nothing calls this directly

Calls 4

getSafeUserStringMethod · 0.80
getFormatMethod · 0.45
setPrecisionMethod · 0.45
setFormatMethod · 0.45

Tested by

no test coverage detected