- Strongly typed arithmetics of physical quantities
- Implemented as value types
- Parsing from strings
- Formatting to strings
- Operators
- Unit conversion
- Extendable (create more quantity types, add units)
- Configurable (set default units for parsing and formatting)
- NuGet package
using QuantityTypes;
Length s = 100 * Length.Metre;
Time t = 9.58 * Time.Second;
Velocity v = s / t;
Console.WriteLine(v);
Console.WriteLine(v.ToString("0.00[km/h]"));
Console.WriteLine("Speed: {0:0.00[!km/h] kmph}", v);
Mass m = Mass.Parse("92 kg");
double massInPounds = m / Mass.Pound;
Temperature temp = 100 * Temperature.DegreeCelsius;
double tempInFahrenheit = temp.ConvertTo(Temperature.DegreeFahrenheit);