Skip to content

四舍五入极值法 #19

@arcsin1

Description

@arcsin1

function roundToNDecimalPlaces(number, n) {
const power = Math.pow(10, n);
const rounded = Math.round((number + Number.EPSILON) * power) / power;
return rounded;
}

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