MathUtils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 2
c 1
b 1
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A smartRound() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rico\Lib;
6
7
use Rico\Slib\MathUtils as StaticMathUtils;
8
9
class MathUtils
10
{
11
    /**
12
     * Rounds a $number adding decimal part only when int part of $number < $idealLength.
13
     *
14
     * @param float $number
15
     * @param int   $idealLength
16
     *
17
     * @return float
18
     */
19
    public function smartRound(float $number, int $idealLength = 3): float
20
    {
21
        return StaticMathUtils::smartRound($number, $idealLength);
22
    }
23
}
24