Passed
Push — master ( a9ba5a...6cd513 )
by Бабичев
02:53
created

Num::format()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 4
crap 1
1
<?php
2
3
namespace Bavix\Helpers;
4
5
class Num
6
{
7
8
    /**
9
     * @param int $min
10
     * @param int $max
11
     *
12
     * @return int
13
     * @throws \Exception
14
     */
15 1
    public static function randomInt($min = PHP_INT_MIN, $max = PHP_INT_MAX)
16
    {
17 1
        return \random_int($min, $max);
18
    }
19
20
    /**
21
     * @param int|float|double $number
22
     * @param int              $decimals
23
     * @param string           $decPoint
24
     * @param string           $thousandsSep
25
     *
26
     * @return string
27
     */
28 1
    public static function format($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',')
29
    {
30 1
        return \number_format($number, $decimals, $decPoint, $thousandsSep);
31
    }
32
33
}
34