Arebis.UnitsAmounts
2.0.8109
dotnet add package Arebis.UnitsAmounts --version 2.0.8109
NuGet\Install-Package Arebis.UnitsAmounts -Version 2.0.8109
<PackageReference Include="Arebis.UnitsAmounts" Version="2.0.8109" />
paket add Arebis.UnitsAmounts --version 2.0.8109
#r "nuget: Arebis.UnitsAmounts, 2.0.8109"
// Install Arebis.UnitsAmounts as a Cake Addin
#addin nuget:?package=Arebis.UnitsAmounts&version=2.0.8109
// Install Arebis.UnitsAmounts as a Cake Tool
#tool nuget:?package=Arebis.UnitsAmounts&version=2.0.8109
About
Arebis.UnitsAmounts is a .Net library for implementing strongly typed units and amounts.
More information is to be found in the original contribution at Arebis Units Amounts.
How to Use
The following code comes from a console application demo program.
namespace SampleConsoleApplication
{
using System;
using Arebis.StandardUnits;
using Arebis.UnitsAmounts;
internal class Program
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0058:Expression value is never used", Justification = "<Pending>")]
private static void Main(string[] args)
{
// Just a sample case:
// ===================
// To allow using units by name, we'll register all units declared in the "StandardUnits" assembly:
UnitManager.RegisterByAssembly(typeof(Arebis.StandardUnits.SIUnitTypes).Assembly);
// I'm driving in a car driving at 70 Miles per hour:
var carSpeed = new Amount(70.0, SpeedUnits.MilePerHour);
// I throw an apple forward through the window at 4 meter per second:
var relativeAppleSpeed = new Amount(4.0, "meter/second");
// So the absolute speed of the apple flowing through the air:
var absoluteAppleSpeed = carSpeed + relativeAppleSpeed;
// Display the result in km/h:
Console.WriteLine("Absolute speed of the apple: {0:#,##0.00 US|kilometer/hour}", absoluteAppleSpeed);
Console.WriteLine();
Console.WriteLine("Press ENTER to end.");
Console.ReadLine();
}
}
}
Key Features
- Full typed units and amounts;
- Numerical operations between the typed units;
- Formatting of typed units values;
Main Types
The main types provided by this library are:
- Unit Defines a physical units such as meter, kilogram, second, newton, etc.
- Amount Consists of a numerical (double precision type) value and a Unit.
Feedback
Arebis.UnitsAmounts is released as open source under the MIT license. Bug reports and contributions are welcome at the Units Amounts repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Arebis.UnitsAmounts:
Package | Downloads |
---|---|
Arebis.UnitsAmounts.Standard.Units
Strongly typed units and amounts and standard units |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.8109 | 247 | 5/28/2022 |