getCanonicalForm method
Implementation
Pair getCanonicalForm(Pair value) {
assert(
checkStringParam(value.unit),
paramError(
'getCanonicalForm', 'value.unit', 'must not be null or empty'));
final Term term = ExpressionParser(model).parse(value.unit);
final Canonical c = Converter(model, handlers).convert(term);
Pair p;
p = Pair(
value: value.value.multiply(c.value),
unit: ExpressionComposer().composeCanonical(c, false));
if (value.value.isWholeNumber()) {
p.value.checkForCouldBeWholeNumber();
}
return p;
}