Skip to content

Update README with v4 changes #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ Stop littering your code with unnecessary calculations, Units.NET gives you all

### Build Targets

* .NET Standard 1.0
* .NET Standard 2.0
* .NET 4.0
* .NET 3.5 Client
* [Windows Runtime Component](https://docs.microsoft.com/en-us/windows/uwp/winrt-components/) for UWP apps (JavaScript, C++ or C#)


### Overview

* [50+ quantities with a total of 600+ units](UnitsNet/GeneratedCode/Units) generated from [JSON](Common/UnitDefinitions/) by [Powershell scripts](UnitsNet/Scripts)
* [1000+ unit tests](https://ci.appveyor.com/project/angularsen/unitsnet) on conversions and localizations
* [89 quantities with over 750 units](UnitsNet/GeneratedCode/Units) generated from [JSON](Common/UnitDefinitions/) by [Powershell scripts](UnitsNet/Scripts)
* [1900+ unit tests](https://ci.appveyor.com/project/angularsen/unitsnet) on conversions and localizations
* Immutable structs that implement `Equatable`, `IComparable`
* [Static typing](#static-typing) to avoid ambiguous values or units
* [Operator overloads](#operator-overloads) for arithmetic on quantities
* [Extension methods](#extension-methods) for short-hand creation and conversions
* [Parse and ToString()](#culture) supports cultures and localization
* [Example: Creating a unit converter app](#example-app)
* [Example: WPF app using IValueConverter to parse quantities from input](#example-wpf-app-using-ivalueconverter-to-parse-quantities-from-input)
Expand Down Expand Up @@ -76,21 +74,6 @@ Acceleration a2 = Force.FromNewtons(100) / Mass.FromKilograms(20);
RotationalSpeed r = Angle.FromDegrees(90) / TimeSpan.FromSeconds(2);
```

### <a name="extension-methods"></a>Extension Methods

All units have associated extension methods for a really compact, expressive way to construct values or do arithmetic.
```C#
using UnitsNet.Extensions.NumberToDuration;
using UnitsNet.Extensions.NumberToLength;
using UnitsNet.Extensions.NumberToTimeSpan;

Speed speed = 30.Kilometers() / 1.Hours(); // 30 km/h (using Duration type)
Length distance = speed * 2.h(); // 60 km (using TimeSpan type)

Acceleration stdGravity = 9.80665.MetersPerSecondSquared();
Force weight = 80.Kilograms() * stdGravity; // 80 kilograms-force or 784.532 newtons
```

### <a name="culture"></a>Culture and Localization

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:
Expand Down