Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i round down?? #760

Open
spencer17x opened this issue Aug 15, 2024 · 2 comments
Open

How can i round down?? #760

spencer17x opened this issue Aug 15, 2024 · 2 comments

Comments

@spencer17x
Copy link

Example:
input: 0.666, output: 0.6

@FedericoGarcia
Copy link

You can use the roundingFunction property like this:

const formatted = numbro(0.666).format({
  mantissa: 1,
  roundingFunction: Math.floor,
});

console.log(formatted); // "0.6"

@spencer17x
Copy link
Author

You can use the roundingFunction property like this:

const formatted = numbro(0.666).format({
  mantissa: 1,
  roundingFunction: Math.floor,
});

console.log(formatted); // "0.6"

Thanks for answering.It works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants