composeCanonical method
Implementation
String composeCanonical(Canonical can, [bool value = true]) {
final StringBuffer buffer = StringBuffer();
if (value) {
buffer.write(can.value.asUcumDecimal());
}
bool first = true;
for (final CanonicalUnit c in can.units) {
if (!first) {
buffer.write('.');
}
first = false;
buffer.write(c.base.code);
if (c.exponent != 1) {
buffer.write(c.exponent);
}
}
return buffer.toString();
}