Strongly typed physical quantities in .NET
C#
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Build status Gitter NuGet Issues

License:       The MIT License (MIT)
Project page:  https://github.com/objorke/QuantityTypes

Features

Examples

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.ConvertTo(Mass.Pound);
Temperature temp = 100 * Temperature.DegreeCelsius;
double tempInFahrenheit = temp.ConvertTo(Temperature.DegreeFahrenheit);