round
round — Rounds a float.Description
round( int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP ): floatReturns the rounded value of num to specified precision (number of digits after the decimal point). precision can also be negative or zero (default).
Parameters
If the precision is positive, num is rounded to precision significant digits after the decimal point.
If the precision is negative, num is rounded to precision significant digits before the decimal point, i.e. to the nearest multiple of pow(10, -precision), e.g. for a precision of -1 num is rounded to tens, for a precision of -2 to hundreds, etc.
Return Values
The value rounded to the given precision as a float.More information about round on official PHP documentation site
round - Popular snippets
- PHP 8.0 / round memory_get_usage
last run:
2023-05-23 23:22:52
111
- PHP 8.2 / microtime round explode end
last run:
2024-08-30 19:40:32
35
- PHP 8.0 / round memory_get_usage str_repeat round memory_get_usage str_repeat
last run:
2021-04-20 15:37:57
21
- PHP 7.4 / microtime round
last run:
2022-03-10 19:44:01
19
- PHP 7.4 / date_default_timezone_set time round
last run:
2023-03-26 15:14:11
18
- PHP 8.0 / mt_rand mt_getrandmax round
last run:
2021-10-20 17:39:04
14
- PHP 8.1 / var_dump round
last run:
2023-06-29 12:17:22
13
- PHP 7.4 / preg_match str_replace date_default_timezone_set strtotime date round abs
last run:
2023-03-26 14:06:36
13
- PHP 8.2 / microtime number_format explode round end
last run:
2024-08-30 19:42:48
9
round - New snippets
-
PHP 8.2 / MariaDB 11.4 json_encode round
added at:
2025-02-17 15:08:34
1
-
PHP 8.2 / MariaDB 11.4 json_encode round
added at:
2025-02-17 15:08:32
2
-
PHP 8.2 / MariaDB 11.4 json_encode round
added at:
2025-02-17 15:08:15
1
-
PHP 8.2 / MariaDB 11.4 json_encode round
added at:
2025-02-17 15:08:04
1
-
PHP 8.2 / MariaDB 11.4 json_encode round
added at:
2025-02-17 15:07:50
1
-
PHP 8.2 / round
added at:
2025-01-23 14:31:38
2
-
PHP 8.2 / round
added at:
2025-01-23 14:31:13
1
-
PHP 8.2 / round
added at:
2025-01-23 14:31:06
3
-
PHP 8.2 / round
added at:
2025-01-23 14:30:55
1
-
PHP 8.1 / MySQL 8.0 round
added at:
2024-12-07 19:01:42
1