-
Notifications
You must be signed in to change notification settings - Fork 386
Extending with Custom Units
In 2.0 we added support for custom units. This means you get to reuse the T4 templates to generate unit classes and extend the UnitSystem class with abbreviations for your new units.
Generally we want to keep the core Units.NET library small, but at the same time cover units that are widely used in different fields of engineering. As a rule of thumb, if the unit is generally known to people outside the engineering or industry domain, then it should be included in the core library. Otherwise, consider creating an external unit or create a new issue for Units.NET to start a discussion.
Candidates for custom units:
- Industry specific units, such as well logging
- Obscure or not widely used units, such as Gamma Ray American Petroleum Institute Unit
Read more at the ThirdPartyExample repository. It uses T4 templates to generate code for the units of measurement Foo and Bar, it has its own tests and a sample app to illustrate how it can be used.