Darzid.UnitOfMeasureLib
1.0.0
See the version list below for details.
dotnet add package Darzid.UnitOfMeasureLib --version 1.0.0
NuGet\Install-Package Darzid.UnitOfMeasureLib -Version 1.0.0
<PackageReference Include="Darzid.UnitOfMeasureLib" Version="1.0.0" />
paket add Darzid.UnitOfMeasureLib --version 1.0.0
#r "nuget: Darzid.UnitOfMeasureLib, 1.0.0"
// Install Darzid.UnitOfMeasureLib as a Cake Addin #addin nuget:?package=Darzid.UnitOfMeasureLib&version=1.0.0 // Install Darzid.UnitOfMeasureLib as a Cake Tool #tool nuget:?package=Darzid.UnitOfMeasureLib&version=1.0.0
Library that simplifies working managing / working with Unit of Measure based-types, like Distance, Weight, Duration etc.
Besides offering these pre-defined Unit of Measure types, it also allows to define your own Unit of Measure types with only a few lines of code, by deriving from UnitOfMeasureTypeBase, and supplying the "scales" for your type as an enum called Scales. The enum values must apply to the following rules:
- Add a Description attribute to each "scale", with the "short name" (like "Mm", "Cm", "Kg")
- The Value of each enum is used to "scale" to the "unscaled" value. When looking at Distance, the scales are "Mm", "Cm", "Dm", "M", "Km". Meters is the default scale, and hence, has the enum value 1. Because there are 100 cm in a meter, the Centimer enum has a value of 100. So, When converting 1 Meter to Centimeters, it multiplies the number of meters with the enum value of 100.
For any scale ABOVE the "default", the enum value must be negative, and acts like the "divider". So, to calculate how many Kilometer one Meter is, 1 Meter needs to be divided by 1000. But, since enum values cannot be doubles, I've opted to model that as negative numbers. So, an enum value of -1000 means that it acts as a divider, instead of multiplier.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net5.0
- Darzid.Sys (>= 1.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Darzid.UnitOfMeasureLib:
Package | Downloads |
---|---|
Darzid.UnitOfMeasureLib.ScalableTypes
Library that simplifies working managing / working with Unit of Measure based-types, like Distance, Weight, Duration etc. Besides offering these pre-defined Unit of Measure types, it also allows to define your own Unit of Measure types with only a few lines of code, by deriving from UnitOfMeasureTypeBase, and supplying the "scales" for your type as an enum called Scales. |
|
Darzid.UnitOfMeasureLib.Scales
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 678 | 5/30/2021 |
2.1.7 | 404 | 5/30/2021 |
2.1.6 | 547 | 5/30/2021 |
2.1.5 | 413 | 5/30/2021 |
2.1.4 | 426 | 5/30/2021 |
2.1.3 | 356 | 5/30/2021 |
2.1.2 | 349 | 5/30/2021 |
2.1.1 | 329 | 5/30/2021 |
2.1.0 | 741 | 5/30/2021 |
2.0.7 | 330 | 5/28/2021 |
2.0.6 | 332 | 5/28/2021 |
2.0.5 | 300 | 5/28/2021 |
2.0.4 | 604 | 5/28/2021 |
2.0.3 | 468 | 5/28/2021 |
2.0.2 | 466 | 5/28/2021 |
2.0.0 | 542 | 5/28/2021 |
1.0.11 | 381 | 6/16/2021 |
1.0.6 | 285 | 5/22/2021 |
1.0.5 | 366 | 5/21/2021 |
1.0.4 | 364 | 5/21/2021 |
1.0.3 | 366 | 5/21/2021 |
1.0.2 | 363 | 5/21/2021 |
1.0.1 | 384 | 5/21/2021 |
1.0.0 | 288 | 5/21/2021 |