Skip to content

Proposal: Alternative nuget with decimal as internal representation #285

Closed
@angularsen

Description

@angularsen

Proposal

  • New nugets: UnitsNet.Decimal, UnitsNet.Decimal.Signed, UnitsNet.Serialization.JsonNet.Decimal, UnitsNet.Serialization.JsonNet.Decimal.Signed
  • Change internal representation from double to decimal

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions