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
![]() |
|||
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 |