@@ -25,6 +25,8 @@ final class Currencies extends ResourceBundle
2525 private const INDEX_NAME = 1 ;
2626 private const INDEX_FRACTION_DIGITS = 0 ;
2727 private const INDEX_ROUNDING_INCREMENT = 1 ;
28+ private const INDEX_CASH_FRACTION_DIGITS = 2 ;
29+ private const INDEX_CASH_ROUNDING_INCREMENT = 3 ;
2830
2931 /**
3032 * @return string[]
@@ -94,10 +96,7 @@ public static function getFractionDigits(string $currency): int
9496 }
9597 }
9698
97- /**
98- * @return float|int
99- */
100- public static function getRoundingIncrement (string $ currency )
99+ public static function getRoundingIncrement (string $ currency ): int
101100 {
102101 try {
103102 return self ::readEntry (['Meta ' , $ currency , self ::INDEX_ROUNDING_INCREMENT ], 'meta ' );
@@ -106,6 +105,24 @@ public static function getRoundingIncrement(string $currency)
106105 }
107106 }
108107
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+
109126 /**
110127 * @throws MissingResourceException if the currency code has no numeric code
111128 */
0 commit comments