/** * Returns the value in the volume field, or Units.UNKNOWN_VALUE if blank. * * @return The entered volume. */ public double getVolume() { double amount = volume.getAmount(); if (amount == Units.UNKNOWN_VALUE) steps.add(Function.latex("\\text{" + name + " volume} = ?")); else steps.add(Function.latex("\\text{" + name + " volume} = " + amount + " L")); return amount; }
/** * Returns the value in the molarity field, or Units.UNKNOWN_VALUE if blank. * * @return The entered molarity. */ public double getMolarity() { double amount = molarity.getAmount(); if (amount == Units.UNKNOWN_VALUE) steps.add(Function.latex("\\text{" + name + " molarity} = ?")); else steps.add(Function.latex("\\text{" + name + " molarity} = " + amount + "\\frac{mol}{L}")); return amount; }