multiply method

Pair multiply(
  1. Pair o1,
  2. Pair o2
)

Implementation

Pair multiply(Pair o1, Pair o2) {
  // Assuming the Pair class has a constructor that takes a UcumDecimal and a String
  // and that UcumDecimal has a multiply method.
  try {
    final UcumDecimal resultValue = o1.value.multiply(o2.value);
    final String resultCode = '${o1.unit}.${o2.unit}';
    final Pair result = Pair(value: resultValue, unit: resultCode);
    return getCanonicalForm(result);
  } catch (e) {
    throw UcumException(e.toString());
  }
}