The doc comment _digits?: string, _round... _cashRounding?: string at position 0 could not be parsed: Unknown type name '_digits?' at position 0 in _digits?: string, _rounding?: string, _cashDigits?: string, _cashRounding?: string.
Loading history...
14
*/
15
public static function from(array $data): self
16
{
17
$digits = (int)($data['_digits'] ?? 2);
18
$rounding = (int)($data['_rounding'] ?? 0);
19
20
return new self(
21
$digits,
22
$rounding,
23
(int)($data['_cashDigits'] ?? $digits),
24
(int)($data['_cashRounding'] ?? $rounding)
25
);
26
}
27
28
/**
29
* @param int $digits
30
* The minimum and maximum number of decimal digits normally formatted.
31
* @param int $rounding
32
* The rounding increment, in units of 10^-digits.
33
* @param int $cash_digits
34
* The number of decimal digits to be used when formatting quantities used in cash transactions.
35
* @param int $cash_rounding
36
* The cash rounding increment, in units of 10^cashDigits.