Price::format()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace IproSync\Ipro;
4
5
class Price
6
{
7 1
    public static function format(float $amount, ?string $currency = null): string
8
    {
9 1
        return $currency.number_format(
10 1
            $amount,
11 1
            (int) config('iprosoftware-sync.number_format.decimals'),
12 1
            config('iprosoftware-sync.number_format.decimal_separator'),
13 1
            config('iprosoftware-sync.number_format.thousands_separator'),
14 1
        );
15
    }
16
}
17