@@ -25,6 +25,8 @@ final class Currencies extends ResourceBundle
25
25
private const INDEX_NAME = 1 ;
26
26
private const INDEX_FRACTION_DIGITS = 0 ;
27
27
private const INDEX_ROUNDING_INCREMENT = 1 ;
28
+ private const INDEX_CASH_FRACTION_DIGITS = 2 ;
29
+ private const INDEX_CASH_ROUNDING_INCREMENT = 3 ;
28
30
29
31
/**
30
32
* @return string[]
@@ -94,10 +96,7 @@ public static function getFractionDigits(string $currency): int
94
96
}
95
97
}
96
98
97
- /**
98
- * @return float|int
99
- */
100
- public static function getRoundingIncrement (string $ currency )
99
+ public static function getRoundingIncrement (string $ currency ): int
101
100
{
102
101
try {
103
102
return self ::readEntry (['Meta ' , $ currency , self ::INDEX_ROUNDING_INCREMENT ], 'meta ' );
@@ -106,6 +105,24 @@ public static function getRoundingIncrement(string $currency)
106
105
}
107
106
}
108
107
108
+ public static function getCashFractionDigits (string $ currency ): int
109
+ {
110
+ try {
111
+ return self ::readEntry (['Meta ' , $ currency , self ::INDEX_CASH_FRACTION_DIGITS ], 'meta ' );
112
+ } catch (MissingResourceException $ e ) {
113
+ return self ::readEntry (['Meta ' , 'DEFAULT ' , self ::INDEX_CASH_FRACTION_DIGITS ], 'meta ' );
114
+ }
115
+ }
116
+
117
+ public static function getCashRoundingIncrement (string $ currency ): int
118
+ {
119
+ try {
120
+ return self ::readEntry (['Meta ' , $ currency , self ::INDEX_CASH_ROUNDING_INCREMENT ], 'meta ' );
121
+ } catch (MissingResourceException $ e ) {
122
+ return self ::readEntry (['Meta ' , 'DEFAULT ' , self ::INDEX_CASH_ROUNDING_INCREMENT ], 'meta ' );
123
+ }
124
+ }
125
+
109
126
/**
110
127
* @throws MissingResourceException if the currency code has no numeric code
111
128
*/
0 commit comments