Skip to content

Instantly share code, notes, and snippets.

@hartez
Created October 12, 2012 19:31
Show Gist options
  • Save hartez/3881027 to your computer and use it in GitHub Desktop.
Save hartez/3881027 to your computer and use it in GitHub Desktop.
Convertinator more complex example
var graph = new ConversionGraph();
var meter = new Unit("meter");
var feet = new Unit("foot");
var kilometer = new Unit("kilometer");
var inches = new Unit("inch");
graph.AddConversion(
Conversions.From(kilometer).To(meter).MultiplyBy(1000M),
Conversions.From(meter).To(feet).MultiplyBy(3.28084M),
Conversions.From(feet).To(inches).MultiplyBy(12M));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment