Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
point85 committed Aug 28, 2021
2 parents 3f01326 + 836fa01 commit 19e4a7b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CaliperSharp/Prefix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Prefix
/// <summary> SI prefix 10^18 </summary>
public static readonly Prefix EXA = new Prefix("exa", "E", 1.0E+18);
/// <summary> SI prefix 10^15 </summary>
public static readonly Prefix PETA = new Prefix("petta", "P", 1.0E+15);
public static readonly Prefix PETA = new Prefix("peta", "P", 1.0E+15);
/// <summary> SI prefix 10^12 </summary>
public static readonly Prefix TERA = new Prefix("tera", "T", 1.0E+12);
/// <summary> SI prefix 10^9 </summary>
Expand Down
16 changes: 16 additions & 0 deletions CaliperSharpTests/TestBridges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,21 @@ public void TestBridgeUnits2()

}
}

[TestMethod]
public void TestBridgeUnits3()
{
UnitOfMeasure uomGrams = sys.GetUOM(Unit.GRAM);
UnitOfMeasure uomTonnes = sys.GetUOM(Unit.TONNE);
UnitOfMeasure uomShortTons = sys.GetUOM(Unit.US_TON);
UnitOfMeasure uomTroyOz = sys.GetUOM(Unit.TROY_OUNCE);
UnitOfMeasure uomPennyweight = sys.CreateScalarUOM(UnitType.MASS, "pennyweight", "dwt", "Pennyweight");
uomPennyweight.SetConversion(0.05, uomTroyOz);
UnitOfMeasure uomGramsPerTonne = sys.CreateQuotientUOM(uomGrams, uomTonnes);
UnitOfMeasure uomPennyweightPerShortTon = sys.CreateQuotientUOM(uomPennyweight, uomShortTons);
Quantity grade = new Quantity(0.95, uomGramsPerTonne);
Quantity converted = grade.Convert(uomPennyweightPerShortTon);
Assert.IsTrue(IsCloseTo(converted.Amount, 0.554167, DELTA6));
}
}
}

0 comments on commit 19e4a7b

Please sign in to comment.