-
-
Notifications
You must be signed in to change notification settings - Fork 18
round
drewmccluskey edited this page Jan 8, 2019
·
4 revisions
This function will round an inputted number.
round(val)
Argument | Description |
---|---|
double val |
The number to round |
Returns: int
This function will round the input number variable. This function is useful when you have a decimal number but you want a whole number such as 5.82 to 6. Uses are common when displaying numbers on the screen and wanting to keep from long trails of decimals.
double numberToRound = 20.45;
var wholeNumber = round(numberToRound); //return 20
This code will round the number 20.45 to 20.
Back to number_functions