Rounding Numbers the Easy Way

2

Stats

4,060 visits, 5,464 views

Tools

Translations

This tutorial hasn't been translated.

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.

Published on 20 Nov, 2014. Last updated 19 Feb, 2019

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

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