Skip to content

long.ToMetric interprets decimals as a required number of fixed decimals instead of desired precision #1699

Description

@logiclrd

Recently, long.ToMetric support was merged. This method parallels int.ToMetric in its specification. However, as was pointed out by @petervanleeuwen, its interpretation of the decimals parameter is incorrect.

   ((int)1).ToMetric(decimals: 5) => "1"
   ((long)1).ToMetric(decimals: 5) => "1.00000" // should be "1" as with int

I will create a PR that corrects this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions