Rounding Numbers the Easy Way

1
  • 10 favourites

Stats

2,718 visits, 3,583 views

Translations

This tutorial hasn't been translated.

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

This tutorial explains how to round a value to a specific number of decimal places.

A simple way to round the value is by multiplying the number by a set amount, rounding it, and then dividing it by that same amount.

(round(variableToRound * 1000)) / 1000

The number of 0's (three in the example above) determines the number of decimal places your rounded text will ultimately display.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!