Skip to content

Use numeral () to convert percentages, occasionally losing precision #723

Open
@Crushdada

Description

@Crushdada

For example, the following code:

Give you a stable value that loses precision.
console.log(numeral("8.14%").value());
// Return value: 0.08140000000000001
It seems that numeral does not have a very good solution to the problem of loss of JS computing accuracy.
Could you tell me how to deal with this bad situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions