Skip to content

Max Decimals #9

@sysmaya

Description

@sysmaya

The script is very perfect. But it needs a parameter. MaxDecimals.
It would be pertinent to restrict the entry to only X number of decimal places.

`x = num.split(obj.decimalSeparator);
y = x[0];
z = x.length > 1 ? obj.decimalSeparator + x[1].slice(0, MaxDecimals) : "";
let rgx = /(\d+)(\d{3})/;

while (rgx.test(y)) {
y = y.replace(rgx, "$1" + obj.separator + "$2");
}`

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