Skip to content

Commit 4b7e784

Browse files
committed
Update README.md
1 parent 1bfbb32 commit 4b7e784

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,25 @@ Build Targets:
1818

1919
Features
2020
===
21-
* 15+ units of measurement, [see full list](https://github.com/InitialForce/UnitsNet/tree/develop/Src/UnitsNet/Units)
21+
* 16 unit classes of measurement, [full list](https://github.com/InitialForce/UnitsNet/tree/develop/Src/UnitsNet/GeneratedCode/Enums)
2222
* Generated code for uniform implementations and fewer bugs
2323
* Immutable structs implementing IEquatable, IComparable and operator overloads
24-
* Extendable with [custom units](https://github.com/InitialForce/UnitsNet/wiki/Extending-with-Custom-Units)
25-
* Localization of abbreviations
24+
* Parse unit abbreviations in multiple cultures
2625
* ToString() variants for custom cultures and format patterns
26+
* Extensible with [custom units](https://github.com/InitialForce/UnitsNet/wiki/Extending-with-Custom-Units)
2727
* Over 200 tests to ensure conversions and localizations are in order
2828

29-
Statically Typed Units
29+
Static Typing
3030
---
3131
```C#
32-
// Convert to the unit of choice - when you need it.
32+
// Convert to the unit of choice - when you need it
3333
Mass weight = GetPersonWeight();
34-
UpdatePersonWeightInGrams(weight.Grams);
34+
Console.WriteLine("You weigh {0:0.#} kg.", weight.Kilograms);
3535

36-
// Avoid confusing conversions, such as between weight and mass.
37-
Mass weight = GetPersonWeight();
36+
// Avoid confusing conversions, such as between weight (force) and mass
3837
double weightNewtons = weight.Newtons; // No such thing
3938
40-
// Some popular conversions.
39+
// Some popular conversions
4140
Length meter = Length.FromMeters(1);
4241
double cm = meter.Centimeters; // 100
4342
double yards = meter.Yards; // 1.09361
@@ -47,7 +46,7 @@ double inches = meter.Inches; // 39.3701
4746

4847
Unit Enumeration
4948
---
50-
All units have a corresponding unit enum value, in fact the unit classes are generated from these. This is useful when you want to let the user choose the unit, such as when editing the height in his user profile.
49+
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.
5150
```C#
5251
/// <summary>Convert the previous height to the new unit.</summary>
5352
void OnUserChangedHeightUnit(LengthUnit prevUnit, double prevValue, LengthUnit newUnit)
@@ -65,15 +64,12 @@ void OnUserChangedHeightUnit(LengthUnit prevUnit, double prevValue, LengthUnit n
6564

6665
Culture and Localization
6766
---
68-
The culture defaults to Thread.CurrentUICulture and affects localization of unit abbreviations as well as number formatting. The relevant methods are:
67+
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:
6968

7069
* ToString()
7170
* GetAbbreviation()
7271
* Parse/TryParse()
73-
* ParseUnit/TryParseUnit() support cultures.
74-
75-
The abbreviations support localization, but currently only US English, Russian and Norwegian are implemented. Localization defaults to US English if no localization for the current/specified culture is found.
76-
72+
* ParseUnit/TryParseUnit()
7773
```C#
7874
var usEnglish = new CultureInfo("en-US");
7975
var russian = new CultureInfo("ru-RU");
@@ -109,19 +105,19 @@ Force.FromMassAcceleration(Mass mass, double metersPerSecondSquared)
109105

110106
Precision and Accuracy
111107
===
112-
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. Also, some conversions may use different constants in different contexts, such as the air temperature or the standard gravity.
108+
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.
113109

114110
Units.NET was intended for convenience and ease of use, not highly accurate conversions, but I am open to suggestions for improvements.
115111

116-
The tests accept an error up to 1E-5 for all the units added so far. In many usecases this is sufficient, but for others this may be a showstopper and something you need to be aware of.
112+
The tests accept an error up to 1E-5 for most units added so far. Exceptions include units like Teaspoon, where the base unit cubic meter is a lot bigger. In many usecases this is sufficient, but for others this may be a showstopper and something you need to be aware of.
117113

118114
For more details, see [Precision](https://github.com/InitialForce/UnitsNet/wiki/Precision).
119115

120116

121117
What It Is Not
122118
===
123-
* It is not an equation solver.
124-
* It does not figure out the units after a calculation.
119+
* It is not an equation solver
120+
* It does not figure out the units after a calculation
125121

126122
Want To Contribute?
127123
==
@@ -133,7 +129,7 @@ The repo uses [git-flow](https://github.com/nvie/gitflow) branch structure.
133129
In practice this means:
134130
* [Fork the repo](https://help.github.com/articles/fork-a-repo) as normal
135131
* Checkout the default **develop** branch. There is no master branch.
136-
* Do work on branches such as **feature/add-myunit** and **fix-some-bug**
132+
* Do work on branches such as **feature/add-myunit** and **fix/34**
137133
* [Create a pull request](https://help.github.com/articles/using-pull-requests) as normal.
138134

139135
Continuous Integration

0 commit comments

Comments
 (0)