Closed
Description
Proposal
- New nugets:
UnitsNet.Decimal
,UnitsNet.Decimal.Signed
,UnitsNet.Serialization.JsonNet.Decimal
,UnitsNet.Serialization.JsonNet.Decimal.Signed
- Change internal representation from
double
todecimal
Why
Decimal has some benefits, such as fixed precision (predictable rounding) and high precision.
However, duplicating all types would nearly double the nuget size, so we propose to create a new nuget using decimal
as internal representation as well as the output type.
Example:
double meters = Length.FromMeters(10).Meters; // currently
decimal meters = Length.FromMeters(10).Meters; // new nuget
Notes
UnitsNet.WindowsRuntimeComponent
nuget is left out due to decimal not supported by type constraints.