1
00:00:00,120 --> 00:00:06,120
We can round decimal numbers to the nearest integer using the math dot round function.

2
00:00:06,390 --> 00:00:13,440
In this example we use the math dot round function to round the value of fifteen point four to the nearest

3
00:00:13,470 --> 00:00:14,910
integer.

4
00:00:14,910 --> 00:00:22,780
Since the value after the decimal is below point five the number will be rounded to 15 we can test this

5
00:00:22,780 --> 00:00:25,030
in our web browser to confirm the results.

6
00:00:31,550 --> 00:00:42,650
This is the output in our web browser and we can see that fifteen point four has been rounded to 15.

7
00:00:42,650 --> 00:00:49,400
Now if we update the value to fifteen point six the number will be rounded to 16

8
00:00:54,980 --> 00:00:59,110
to specify whether the value should be rounded up or down.

9
00:00:59,180 --> 00:01:06,150
We can use the math dot seal or math dot floor function.

10
00:01:06,240 --> 00:01:12,840
Let's go ahead and specify that we want fifteen point six to be rounded down so we'll change it to math

11
00:01:12,840 --> 00:01:18,590
dot floor after saving the file and refreshing the page.

12
00:01:18,590 --> 00:01:27,600
We can see that it now rounds down if we wanted to rounded up to 16 we can specify that by putting math

13
00:01:27,600 --> 00:01:28,260
dot seal

14
00:01:32,380 --> 00:01:37,330
and once we refresh the web browser we can see that the value has now been rounded up to 16.
