コード例 #1
0
 /**
  * Converts the molarity to the desired unit.
  *
  * @param before The molarity in mol/L
  * @return The molarity in the desired unit.
  */
 public double getMolarity(double before) {
   double after = molarity.getBlankAmount(before);
   if (after != before)
     steps.add(
         Function.latex(
             before
                 + " \\{mol}{L} = "
                 + after
                 + "\\frac{"
                 + molarity.getUnitName()
                 + "}{"
                 + molarity.getUnit2Name()
                 + "}"));
   return after;
 }
コード例 #2
0
 /**
  * Converts the volume to the desired unit.
  *
  * @param before The volume in L
  * @return The volume in the desired unit.
  */
 public double getVolume(double before) {
   double after = volume.getBlankAmount(before);
   unit = volume.getUnitName();
   if (after != before) steps.add(Function.latex(before + " L = " + after + " " + unit));
   return after;
 }