Browse Source

Add metric spoons

Mads Møller Jensen 9 months ago
parent
commit
8c05e9fd26
2 changed files with 13 additions and 0 deletions
  1. 3 0
      examples/tests/unit_consistency_misc.nbt
  2. 10 0
      numbat/modules/units/misc.nbt

+ 3 - 0
examples/tests/unit_consistency_misc.nbt

@@ -17,6 +17,9 @@ assert_eq(1 gregorian_year, 365.2425 day)
 assert_eq(1 julian_year, 365.25 day)
 assert_eq(1 julian_year, 365.25 day)
 assert_eq(1 year, 1 tropical_year)
 assert_eq(1 year, 1 tropical_year)
 
 
+assert_eq(1 teaspoon, 5 mL, 1e-5 teaspoon)
+assert_eq(3 teaspoon, 1 tablespoon, 1e-5 teaspoon)
+
 assert_eq(1 gallon, 231 inch³, 1e-5 inch³)
 assert_eq(1 gallon, 231 inch³, 1e-5 inch³)
 assert_eq(8 pint, 1 gallon)
 assert_eq(8 pint, 1 gallon)
 assert_eq(2 cup, 1 pint)
 assert_eq(2 cup, 1 pint)

+ 10 - 0
numbat/modules/units/misc.nbt

@@ -173,3 +173,13 @@ unit cc: Volume = cm^3
 @name("Fermi")
 @name("Fermi")
 @url("https://en.wikipedia.org/wiki/Femtometre")
 @url("https://en.wikipedia.org/wiki/Femtometre")
 unit fermi: Length = 1 fm
 unit fermi: Length = 1 fm
+
+@name("Metric tablespoon")
+@url("https://en.wikipedia.org/wiki/Tablespoon")
+@aliases(tablespoons, tbsp: short)
+unit tablespoon: Volume = 15 mL
+
+@name("Metric teaspoon")
+@url("https://en.wikipedia.org/wiki/Teaspoon")
+@aliases(teaspoons, tsp: short)
+unit teaspoon: Volume = 1/3 × tablespoon