We can round decimal numbers to the nearest integer using the math dot round function.
In this example we use the math dot round function to round the value of fifteen point four to the nearest
integer.
Since the value after the decimal is below point five the number will be rounded to 15 we can test this
in our web browser to confirm the results.
This is the output in our web browser and we can see that fifteen point four has been rounded to 15.
Now if we update the value to fifteen point six the number will be rounded to 16
to specify whether the value should be rounded up or down.
We can use the math dot seal or math dot floor function.
Let's go ahead and specify that we want fifteen point six to be rounded down so we'll change it to math
dot floor after saving the file and refreshing the page.
We can see that it now rounds down if we wanted to rounded up to 16 we can specify that by putting math
dot seal
and once we refresh the web browser we can see that the value has now been rounded up to 16.