private NumberData parseNumberData ( LocaleID id , String code , JsonObject root ) { NumberData data = getNumberData ( id ) ; JsonObject numbers = resolve ( root , "numbers" ) ; data . minimumGroupingDigits = Integer . valueOf ( string ( numbers , "minimumGroupingDigits" ) ) ; JsonObject symbols = resolve ( numbers , "symbols-numberSystem-latn" ) ; data . decimal = string ( symbols , "decimal" ) ; data . group = string ( symbols , "group" ) ; data . percent = string ( symbols , "percentSign" ) ; data . plus = string ( symbols , "plusSign" ) ; data . minus = string ( symbols , "minusSign" ) ; data . exponential = string ( symbols , "exponential" ) ; data . superscriptingExponent = string ( symbols , "superscriptingExponent" ) ; data . perMille = string ( symbols , "perMille" ) ; data . infinity = string ( symbols , "infinity" ) ; data . nan = string ( symbols , "nan" ) ; // The fields 'currencyDecimal' and 'currencyGroup' are only defined for a few locales data . currencyDecimal = string ( symbols , "currencyDecimal" , data . decimal ) ; data . currencyGroup = string ( symbols , "currencyGroup" , data . group ) ; JsonObject decimalFormats = resolve ( numbers , "decimalFormats-numberSystem-latn" ) ; data . decimalFormatStandard = getNumberPattern ( string ( decimalFormats , "standard" ) ) ; data . decimalFormatShort = getPluralNumberPattern ( resolve ( decimalFormats , "short" , "decimalFormat" ) ) ; data . decimalFormatLong = getPluralNumberPattern ( resolve ( decimalFormats , "long" , "decimalFormat" ) ) ; JsonObject percentFormats = resolve ( numbers , "percentFormats-numberSystem-latn" ) ; data . percentFormatStandard = getNumberPattern ( string ( percentFormats , "standard" ) ) ; JsonObject currencyFormats = resolve ( numbers , "currencyFormats-numberSystem-latn" ) ; data . currencyFormatStandard = getNumberPattern ( string ( currencyFormats , "standard" ) ) ; data . currencyFormatAccounting = getNumberPattern ( string ( currencyFormats , "accounting" ) ) ; data . currencyFormatShort = getPluralNumberPattern ( resolve ( currencyFormats , "short" , "standard" ) ) ; data . currencyUnitPattern = new HashMap <> ( ) ; for ( String key : objectKeys ( currencyFormats ) ) { if ( key . startsWith ( "unitPattern-count" ) ) { data . currencyUnitPattern . put ( key , string ( currencyFormats , key ) ) ; } } return data ; }
Parse number and some currency data for locale .