You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All units have a corresponding unit enum value. This is useful when selecting the unit representation at runtime, such as presenting a choice of units to the user.
51
57
```C#
52
-
/// <summary>Convert the previous height to the new unit.</summary>
The culture for abbreviations defaults to Thread.CurrentUICulture and falls back to US English if not defined. Thread.CurrentCulture affects number formatting unless a custom culture is specified. The relevant methods are:
// Update UI with the converted value and the newly selected unit
117
+
UpdateHeightUI(newHeightValue, newUnit);
118
+
}
105
119
```
106
120
107
-
Precision and Accuracy
121
+
<aname="precision"></a>Precision and Accuracy
108
122
===
109
123
A base unit is chosen for each unit class, represented by a double value (64-bit), and all conversions go via this unit. This means there will always be a small error in both representing other units than the base unit as well as converting between units.
110
124
@@ -114,7 +128,8 @@ The tests accept an error up to 1E-5 for most units added so far. Exceptions inc
114
128
115
129
For more details, see [Precision](https://github.com/anjdreas/UnitsNet/wiki/Precision).
116
130
117
-
Serialization
131
+
132
+
<aname="serialization"></a>Serialization
118
133
===
119
134
*`UnitsNet.Serialization.JsonNet` ([nuget](https://www.nuget.org/packages/UnitsNet.Serialization.JsonNet), [src](https://github.com/anjdreas/UnitsNet/tree/master/UnitsNet.Serialization.JsonNet), [tests](https://github.com/anjdreas/UnitsNet/tree/master/UnitsNet.Serialization.JsonNet.Tests)) for JSON.NET
120
135
@@ -123,12 +138,8 @@ We cannot guarantee backwards compatibility, although we will strive to do that
123
138
124
139
The base unit of any unit should be be treated as volatile as we have changed this several times in the history of this library already. Either to reduce precision errors of common units or to simplify code generation. An example is Mass, where the base unit was first Kilogram as this is the SI unit of mass, but in order to use powershell scripts to generate milligrams, nanograms etc. it was easier to choose Gram as the base unit of Mass.
125
140
126
-
What It Is Not
127
-
===
128
-
* It is not an equation solver
129
-
* It does not figure out the units after a calculation
130
141
131
-
Want To Contribute?
142
+
<aname="contribute"></a>Want To Contribute?
132
143
==
133
144
This project is still early and many units and conversions are not yet covered. If you are missing something, please help by contributing or [ask for it](https://github.com/anjdreas/UnitsNet/issues) by creating an issue.
134
145
@@ -140,13 +151,13 @@ Generally adding a unit involves adding or modifying `UnitsNet\Scripts\UnitDefin
140
151
* Do work on branches such as **feature/add-myunit** and **fix/34**
141
152
*[Create a pull request](https://help.github.com/articles/using-pull-requests)
142
153
143
-
Continuous Integration
154
+
<aname="ci"></a>Continuous Integration
144
155
===
145
156
A [TeamCity build server](http://teamcity.chump.work/viewType.html?buildTypeId=UnitsNet&guest=1) performs the following:
146
157
* Build and test pull requests. Notifies on success or error.
147
158
* Build, test and deploy nuget on master branch.
148
159
149
-
Who are Using This?
160
+
<aname="who-are-using"></a>Who are Using This?
150
161
===
151
162
It would be awesome to know who are using this library. If you would like your project listed here, [create an issue](https://github.com/anjdreas/UnitsNet/issues) or edit the [README.md](https://github.com/anjdreas/UnitsNet/edit/master/README.md) and send a pull request. Max logo size is `300x35 pixels` and should be in `.png`, `.gif` or `.jpg` formats.
0 commit comments