Skip to content

Instantly share code, notes, and snippets.

@hartez
Created October 12, 2012 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hartez/3881054 to your computer and use it in GitHub Desktop.
Save hartez/3881054 to your computer and use it in GitHub Desktop.
Convertinator temperature
var temperature = new ConversionGraph();
var fahrenheit = new Unit("degrees Fahrenheit")
.IsAlsoCalled("Fahrenheit")
.CanBeAbbreviated("°F")
.PluralizeAs("°F");
temperature.AddConversion(
Conversions.From(fahrenheit).To(celcius).Subtract(32).MultiplyBy(5M / 9M));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment