NumberFormatterLocalized::format()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace ICanBoogie\CLDR\Numbers;
4
5
use ICanBoogie\CLDR\Core\Formatter;
6
use ICanBoogie\CLDR\Core\LocalizedObject;
7
8
/**
9
 * Formats numbers using locale conventions.
10
 *
11
 * @extends LocalizedObject<NumberFormatter>
12
 */
13
class NumberFormatterLocalized extends LocalizedObject implements Formatter
14
{
15
    /**
16
     * Formats a number.
17
     *
18
     * @param float|int|numeric-string $number
0 ignored issues
show
Documentation Bug introduced by
The doc comment float|int|numeric-string at position 4 could not be parsed: Unknown type name 'numeric-string' at position 4 in float|int|numeric-string.
Loading history...
19
     */
20
    public function format(float|int|string $number, ?string $pattern = null): string
21
    {
22
        $numbers = $this->locale->numbers;
23
24
        return $this->target->format($number, $pattern ?? $numbers->standard_decimal_format, $numbers->symbols);
25
    }
26
}
27