MassCreation extension

Provides convenient factory methods for creating Mass instances from num using getter properties named after common unit symbols or names.

This allows for an intuitive and concise way to create mass quantities, for example: 70.kg or 500.grams.

on

Properties

atomicMassUnits Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Atomic Mass Units (u). Alias for u.
no setter
carats Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Carats (ct). Alias for ct.
no setter
cg Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Centigrams (cg).
no setter
ct Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Carats (ct).
no setter
dag Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Decagrams (dag).
no setter
dg Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Decigrams (dg).
no setter
g Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Grams (g).
no setter
gigaG Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Gigagrams (Gg).
no setter
grams Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Grams (g). Alias for g.
no setter
hg Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Hectograms (hg).
no setter
kg Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Kilograms (kg).
no setter
lb Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Pounds (lb).
no setter
longTons Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Long Tons (UK).
no setter
megaG Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Megagrams (Mg).
no setter
mg Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Milligrams (mg).
no setter
micrograms Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Micrograms (μg). Alias for ug.
no setter
milligrams Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Milligrams (mg). Alias for mg.
no setter
nanograms Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Nanograms (ng). Alias for ng.
no setter
ng Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Nanograms (ng).
no setter
ounces Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Ounces (oz). Alias for oz.
no setter
oz Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Ounces (oz).
no setter
pounds Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Pounds (lb). Alias for lb.
no setter
shortTons Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Short Tons (US).
no setter
slugs Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Slugs (slug).
no setter
st Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Stones (st).
no setter
stones Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Stones (st). Alias for st.
no setter
t Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Tonnes (t, metric tons).
no setter
tonnes Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Tonnes (t, metric tons). Alias for t.
no setter
u Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Atomic Mass Units (u).
no setter
ug Mass

Available on num, provided by the MassCreation extension

Creates a Mass instance representing this numerical value in Micrograms (μg).
no setter