Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.squarespace.cldr.numbers._NumberFormatter_root Maven / Gradle / Ivy
//
//
// AUTO-GENERATED CLASS - DO NOT EDIT
//
//
package com.squarespace.cldr.numbers;
import com.squarespace.cldr.CLDR;
import com.squarespace.cldr.parse.FieldPattern;
import com.squarespace.cldr.plurals.PluralCategory;
import com.squarespace.cldr.units.Unit;
import java.lang.Math;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
public class _NumberFormatter_root extends NumberFormatterBase {
protected static final int[] DECIMAL_SHORT_DIVISORS = new int[] { 0,0,0,3,3,3,6,6,6,9,9,9,12,12,12 };
protected static final NumberPattern[][] DECIMAL_SHORT_OTHER = new NumberPattern[][] {
/* 1 */ patterns("#,##0.###", "-#,##0.###"),
/* 10 */ patterns("#,##0.###", "-#,##0.###"),
/* 100 */ patterns("#,##0.###", "-#,##0.###"),
/* 1K */ patterns("0K", "-0K"),
/* 10K */ patterns("00K", "-00K"),
/* 100K */ patterns("000K", "-000K"),
/* 1M */ patterns("0M", "-0M"),
/* 10M */ patterns("00M", "-00M"),
/* 100M */ patterns("000M", "-000M"),
/* 1B */ patterns("0G", "-0G"),
/* 10B */ patterns("00G", "-00G"),
/* 100B */ patterns("000G", "-000G"),
/* 1T */ patterns("0T", "-0T"),
/* 10T */ patterns("00T", "-00T"),
/* 100T */ patterns("000T", "-000T")}
;
protected static final int[] DECIMAL_LONG_DIVISORS = new int[] { 0,0,0,3,3,3,6,6,6,9,9,9,12,12,12 };
protected static final NumberPattern[][] DECIMAL_LONG_OTHER = new NumberPattern[][] {
/* 1 */ patterns("#,##0.###", "-#,##0.###"),
/* 10 */ patterns("#,##0.###", "-#,##0.###"),
/* 100 */ patterns("#,##0.###", "-#,##0.###"),
/* 1K */ patterns("0K", "-0K"),
/* 10K */ patterns("00K", "-00K"),
/* 100K */ patterns("000K", "-000K"),
/* 1M */ patterns("0M", "-0M"),
/* 10M */ patterns("00M", "-00M"),
/* 100M */ patterns("000M", "-000M"),
/* 1B */ patterns("0G", "-0G"),
/* 10B */ patterns("00G", "-00G"),
/* 100B */ patterns("000G", "-000G"),
/* 1T */ patterns("0T", "-0T"),
/* 10T */ patterns("00T", "-00T"),
/* 100T */ patterns("000T", "-000T")}
;
protected static final int[] CURRENCY_SHORT_DIVISORS = new int[] { 0,0,0,3,3,3,6,6,6,9,9,9,12,12,12 };
protected static final NumberPattern[][] CURRENCY_SHORT_OTHER = new NumberPattern[][] {
/* 1 */ patterns("¤ #,##0.00", "-¤ #,##0.00"),
/* 10 */ patterns("¤ #,##0.00", "-¤ #,##0.00"),
/* 100 */ patterns("¤ #,##0.00", "-¤ #,##0.00"),
/* 1K */ patterns("¤ 0K", "-¤ 0K"),
/* 10K */ patterns("¤ 00K", "-¤ 00K"),
/* 100K */ patterns("¤ 000K", "-¤ 000K"),
/* 1M */ patterns("¤ 0M", "-¤ 0M"),
/* 10M */ patterns("¤ 00M", "-¤ 00M"),
/* 100M */ patterns("¤ 000M", "-¤ 000M"),
/* 1B */ patterns("¤ 0G", "-¤ 0G"),
/* 10B */ patterns("¤ 00G", "-¤ 00G"),
/* 100B */ patterns("¤ 000G", "-¤ 000G"),
/* 1T */ patterns("¤ 0T", "-¤ 0T"),
/* 10T */ patterns("¤ 00T", "-¤ 00T"),
/* 100T */ patterns("¤ 000T", "-¤ 000T")}
;
protected static final Map> UNITS_LONG_OTHER = new EnumMap>(Unit.class) {{
put(Unit.G_FORCE, unitPattern("{0} G"));
put(Unit.METER_PER_SECOND_SQUARED, unitPattern("{0} m/s²"));
put(Unit.ARC_MINUTE, unitPattern("{0}′"));
put(Unit.ARC_SECOND, unitPattern("{0}″"));
put(Unit.DEGREE, unitPattern("{0}°"));
put(Unit.RADIAN, unitPattern("{0} rad"));
put(Unit.REVOLUTION, unitPattern("{0} rev"));
put(Unit.ACRE, unitPattern("{0} ac"));
put(Unit.HECTARE, unitPattern("{0} ha"));
put(Unit.SQUARE_CENTIMETER, unitPattern("{0} cm²"));
put(Unit.SQUARE_FOOT, unitPattern("{0} ft²"));
put(Unit.SQUARE_INCH, unitPattern("{0} in²"));
put(Unit.SQUARE_KILOMETER, unitPattern("{0} km²"));
put(Unit.SQUARE_METER, unitPattern("{0} m²"));
put(Unit.SQUARE_MILE, unitPattern("{0} mi²"));
put(Unit.SQUARE_YARD, unitPattern("{0} yd²"));
put(Unit.KARAT, unitPattern("{0} kt"));
put(Unit.MILLIGRAM_PER_DECILITER, unitPattern("{0} mg/dL"));
put(Unit.MILLIMOLE_PER_LITER, unitPattern("{0} mmol/L"));
put(Unit.PART_PER_MILLION, unitPattern("{0} ppm"));
put(Unit.LITER_PER_100KILOMETERS, unitPattern("{0} L/100km"));
put(Unit.LITER_PER_KILOMETER, unitPattern("{0} L/km"));
put(Unit.MILE_PER_GALLON, unitPattern("{0} mpg US"));
put(Unit.MILE_PER_GALLON_IMPERIAL, unitPattern("{0} mpg Imp."));
put(Unit.BIT, unitPattern("{0} bit"));
put(Unit.BYTE, unitPattern("{0} byte"));
put(Unit.GIGABIT, unitPattern("{0} Gb"));
put(Unit.GIGABYTE, unitPattern("{0} GB"));
put(Unit.KILOBIT, unitPattern("{0} kb"));
put(Unit.KILOBYTE, unitPattern("{0} kB"));
put(Unit.MEGABIT, unitPattern("{0} Mb"));
put(Unit.MEGABYTE, unitPattern("{0} MB"));
put(Unit.TERABIT, unitPattern("{0} Tb"));
put(Unit.TERABYTE, unitPattern("{0} TB"));
put(Unit.CENTURY, unitPattern("{0} c"));
put(Unit.DAY, unitPattern("{0} d"));
put(Unit.HOUR, unitPattern("{0} h"));
put(Unit.MICROSECOND, unitPattern("{0} μs"));
put(Unit.MILLISECOND, unitPattern("{0} ms"));
put(Unit.MINUTE, unitPattern("{0} min"));
put(Unit.MONTH, unitPattern("{0} m"));
put(Unit.NANOSECOND, unitPattern("{0} ns"));
put(Unit.SECOND, unitPattern("{0} s"));
put(Unit.WEEK, unitPattern("{0} w"));
put(Unit.YEAR, unitPattern("{0} y"));
put(Unit.AMPERE, unitPattern("{0} A"));
put(Unit.MILLIAMPERE, unitPattern("{0} mA"));
put(Unit.OHM, unitPattern("{0} Ω"));
put(Unit.VOLT, unitPattern("{0} V"));
put(Unit.CALORIE, unitPattern("{0} cal"));
put(Unit.FOODCALORIE, unitPattern("{0} Cal"));
put(Unit.JOULE, unitPattern("{0} J"));
put(Unit.KILOCALORIE, unitPattern("{0} kcal"));
put(Unit.KILOJOULE, unitPattern("{0} kJ"));
put(Unit.KILOWATT_HOUR, unitPattern("{0} kWh"));
put(Unit.GIGAHERTZ, unitPattern("{0} GHz"));
put(Unit.HERTZ, unitPattern("{0} Hz"));
put(Unit.KILOHERTZ, unitPattern("{0} kHz"));
put(Unit.MEGAHERTZ, unitPattern("{0} MHz"));
put(Unit.ASTRONOMICAL_UNIT, unitPattern("{0} au"));
put(Unit.CENTIMETER, unitPattern("{0} cm"));
put(Unit.DECIMETER, unitPattern("{0} dm"));
put(Unit.FATHOM, unitPattern("{0} fm"));
put(Unit.FOOT, unitPattern("{0} ft"));
put(Unit.FURLONG, unitPattern("{0} fur"));
put(Unit.INCH, unitPattern("{0} in"));
put(Unit.KILOMETER, unitPattern("{0} km"));
put(Unit.LIGHT_YEAR, unitPattern("{0} ly"));
put(Unit.METER, unitPattern("{0} m"));
put(Unit.MICROMETER, unitPattern("{0} µm"));
put(Unit.MILE, unitPattern("{0} mi"));
put(Unit.MILE_SCANDINAVIAN, unitPattern("{0} smi"));
put(Unit.MILLIMETER, unitPattern("{0} mm"));
put(Unit.NANOMETER, unitPattern("{0} nm"));
put(Unit.NAUTICAL_MILE, unitPattern("{0} nmi"));
put(Unit.PARSEC, unitPattern("{0} pc"));
put(Unit.PICOMETER, unitPattern("{0} pm"));
put(Unit.POINT, unitPattern("{0} pt"));
put(Unit.YARD, unitPattern("{0} yd"));
put(Unit.LUX, unitPattern("{0} lx"));
put(Unit.CARAT, unitPattern("{0} CD"));
put(Unit.GRAM, unitPattern("{0} g"));
put(Unit.KILOGRAM, unitPattern("{0} kg"));
put(Unit.METRIC_TON, unitPattern("{0} t"));
put(Unit.MICROGRAM, unitPattern("{0} µg"));
put(Unit.MILLIGRAM, unitPattern("{0} mg"));
put(Unit.OUNCE, unitPattern("{0} oz"));
put(Unit.OUNCE_TROY, unitPattern("{0} oz t"));
put(Unit.POUND, unitPattern("{0} lb"));
put(Unit.STONE, unitPattern("{0} st"));
put(Unit.TON, unitPattern("{0} tn"));
put(Unit.GIGAWATT, unitPattern("{0} GW"));
put(Unit.HORSEPOWER, unitPattern("{0} hp"));
put(Unit.KILOWATT, unitPattern("{0} kW"));
put(Unit.MEGAWATT, unitPattern("{0} MW"));
put(Unit.MILLIWATT, unitPattern("{0} mW"));
put(Unit.WATT, unitPattern("{0} W"));
put(Unit.HECTOPASCAL, unitPattern("{0} hPa"));
put(Unit.INCH_HG, unitPattern("{0} inHg"));
put(Unit.MILLIBAR, unitPattern("{0} mbar"));
put(Unit.MILLIMETER_OF_MERCURY, unitPattern("{0} mm Hg"));
put(Unit.POUND_PER_SQUARE_INCH, unitPattern("{0} psi"));
put(Unit.KILOMETER_PER_HOUR, unitPattern("{0} km/h"));
put(Unit.KNOT, unitPattern("{0} kn"));
put(Unit.METER_PER_SECOND, unitPattern("{0} m/s"));
put(Unit.MILE_PER_HOUR, unitPattern("{0} mi/h"));
put(Unit.CELSIUS, unitPattern("{0}°C"));
put(Unit.FAHRENHEIT, unitPattern("{0}°F"));
put(Unit.TEMPERATURE_GENERIC, unitPattern("{0}°"));
put(Unit.KELVIN, unitPattern("{0} K"));
put(Unit.ACRE_FOOT, unitPattern("{0} ac ft"));
put(Unit.BUSHEL, unitPattern("{0} bu"));
put(Unit.CENTILITER, unitPattern("{0} cL"));
put(Unit.CUBIC_CENTIMETER, unitPattern("{0} cm³"));
put(Unit.CUBIC_FOOT, unitPattern("{0} ft³"));
put(Unit.CUBIC_INCH, unitPattern("{0} in³"));
put(Unit.CUBIC_KILOMETER, unitPattern("{0} km³"));
put(Unit.CUBIC_METER, unitPattern("{0} m³"));
put(Unit.CUBIC_MILE, unitPattern("{0} mi³"));
put(Unit.CUBIC_YARD, unitPattern("{0} yd³"));
put(Unit.CUP, unitPattern("{0} c"));
put(Unit.CUP_METRIC, unitPattern("{0} mc"));
put(Unit.DECILITER, unitPattern("{0} dL"));
put(Unit.FLUID_OUNCE, unitPattern("{0} fl oz"));
put(Unit.GALLON, unitPattern("{0} gal US"));
put(Unit.GALLON_IMPERIAL, unitPattern("{0} gal Imp."));
put(Unit.HECTOLITER, unitPattern("{0} hL"));
put(Unit.LITER, unitPattern("{0} l"));
put(Unit.MEGALITER, unitPattern("{0} ML"));
put(Unit.MILLILITER, unitPattern("{0} mL"));
put(Unit.PINT, unitPattern("{0} pt"));
put(Unit.PINT_METRIC, unitPattern("{0} mpt"));
put(Unit.QUART, unitPattern("{0} qt"));
put(Unit.TABLESPOON, unitPattern("{0} tbsp"));
put(Unit.TEASPOON, unitPattern("{0} tsp"));
}};
protected static final Map> UNITS_NARROW_OTHER = new EnumMap>(Unit.class) {{
put(Unit.G_FORCE, unitPattern("{0} G"));
put(Unit.METER_PER_SECOND_SQUARED, unitPattern("{0} m/s²"));
put(Unit.ARC_MINUTE, unitPattern("{0}′"));
put(Unit.ARC_SECOND, unitPattern("{0}″"));
put(Unit.DEGREE, unitPattern("{0}°"));
put(Unit.RADIAN, unitPattern("{0} rad"));
put(Unit.REVOLUTION, unitPattern("{0} rev"));
put(Unit.ACRE, unitPattern("{0} ac"));
put(Unit.HECTARE, unitPattern("{0} ha"));
put(Unit.SQUARE_CENTIMETER, unitPattern("{0} cm²"));
put(Unit.SQUARE_FOOT, unitPattern("{0} ft²"));
put(Unit.SQUARE_INCH, unitPattern("{0} in²"));
put(Unit.SQUARE_KILOMETER, unitPattern("{0} km²"));
put(Unit.SQUARE_METER, unitPattern("{0} m²"));
put(Unit.SQUARE_MILE, unitPattern("{0} mi²"));
put(Unit.SQUARE_YARD, unitPattern("{0} yd²"));
put(Unit.KARAT, unitPattern("{0} kt"));
put(Unit.MILLIGRAM_PER_DECILITER, unitPattern("{0} mg/dL"));
put(Unit.MILLIMOLE_PER_LITER, unitPattern("{0} mmol/L"));
put(Unit.PART_PER_MILLION, unitPattern("{0} ppm"));
put(Unit.LITER_PER_100KILOMETERS, unitPattern("{0} L/100km"));
put(Unit.LITER_PER_KILOMETER, unitPattern("{0} L/km"));
put(Unit.MILE_PER_GALLON, unitPattern("{0} mpg US"));
put(Unit.MILE_PER_GALLON_IMPERIAL, unitPattern("{0} mpg Imp."));
put(Unit.BIT, unitPattern("{0} bit"));
put(Unit.BYTE, unitPattern("{0} byte"));
put(Unit.GIGABIT, unitPattern("{0} Gb"));
put(Unit.GIGABYTE, unitPattern("{0} GB"));
put(Unit.KILOBIT, unitPattern("{0} kb"));
put(Unit.KILOBYTE, unitPattern("{0} kB"));
put(Unit.MEGABIT, unitPattern("{0} Mb"));
put(Unit.MEGABYTE, unitPattern("{0} MB"));
put(Unit.TERABIT, unitPattern("{0} Tb"));
put(Unit.TERABYTE, unitPattern("{0} TB"));
put(Unit.CENTURY, unitPattern("{0} c"));
put(Unit.DAY, unitPattern("{0} d"));
put(Unit.HOUR, unitPattern("{0} h"));
put(Unit.MICROSECOND, unitPattern("{0} μs"));
put(Unit.MILLISECOND, unitPattern("{0} ms"));
put(Unit.MINUTE, unitPattern("{0} min"));
put(Unit.MONTH, unitPattern("{0} m"));
put(Unit.NANOSECOND, unitPattern("{0} ns"));
put(Unit.SECOND, unitPattern("{0} s"));
put(Unit.WEEK, unitPattern("{0} w"));
put(Unit.YEAR, unitPattern("{0} y"));
put(Unit.AMPERE, unitPattern("{0} A"));
put(Unit.MILLIAMPERE, unitPattern("{0} mA"));
put(Unit.OHM, unitPattern("{0} Ω"));
put(Unit.VOLT, unitPattern("{0} V"));
put(Unit.CALORIE, unitPattern("{0} cal"));
put(Unit.FOODCALORIE, unitPattern("{0} Cal"));
put(Unit.JOULE, unitPattern("{0} J"));
put(Unit.KILOCALORIE, unitPattern("{0} kcal"));
put(Unit.KILOJOULE, unitPattern("{0} kJ"));
put(Unit.KILOWATT_HOUR, unitPattern("{0} kWh"));
put(Unit.GIGAHERTZ, unitPattern("{0} GHz"));
put(Unit.HERTZ, unitPattern("{0} Hz"));
put(Unit.KILOHERTZ, unitPattern("{0} kHz"));
put(Unit.MEGAHERTZ, unitPattern("{0} MHz"));
put(Unit.ASTRONOMICAL_UNIT, unitPattern("{0} au"));
put(Unit.CENTIMETER, unitPattern("{0} cm"));
put(Unit.DECIMETER, unitPattern("{0} dm"));
put(Unit.FATHOM, unitPattern("{0} fm"));
put(Unit.FOOT, unitPattern("{0} ft"));
put(Unit.FURLONG, unitPattern("{0} fur"));
put(Unit.INCH, unitPattern("{0} in"));
put(Unit.KILOMETER, unitPattern("{0} km"));
put(Unit.LIGHT_YEAR, unitPattern("{0} ly"));
put(Unit.METER, unitPattern("{0} m"));
put(Unit.MICROMETER, unitPattern("{0} µm"));
put(Unit.MILE, unitPattern("{0} mi"));
put(Unit.MILE_SCANDINAVIAN, unitPattern("{0} smi"));
put(Unit.MILLIMETER, unitPattern("{0} mm"));
put(Unit.NANOMETER, unitPattern("{0} nm"));
put(Unit.NAUTICAL_MILE, unitPattern("{0} nmi"));
put(Unit.PARSEC, unitPattern("{0} pc"));
put(Unit.PICOMETER, unitPattern("{0} pm"));
put(Unit.POINT, unitPattern("{0} pt"));
put(Unit.YARD, unitPattern("{0} yd"));
put(Unit.LUX, unitPattern("{0} lx"));
put(Unit.CARAT, unitPattern("{0} CD"));
put(Unit.GRAM, unitPattern("{0} g"));
put(Unit.KILOGRAM, unitPattern("{0} kg"));
put(Unit.METRIC_TON, unitPattern("{0} t"));
put(Unit.MICROGRAM, unitPattern("{0} µg"));
put(Unit.MILLIGRAM, unitPattern("{0} mg"));
put(Unit.OUNCE, unitPattern("{0} oz"));
put(Unit.OUNCE_TROY, unitPattern("{0} oz t"));
put(Unit.POUND, unitPattern("{0} lb"));
put(Unit.STONE, unitPattern("{0} st"));
put(Unit.TON, unitPattern("{0} tn"));
put(Unit.GIGAWATT, unitPattern("{0} GW"));
put(Unit.HORSEPOWER, unitPattern("{0} hp"));
put(Unit.KILOWATT, unitPattern("{0} kW"));
put(Unit.MEGAWATT, unitPattern("{0} MW"));
put(Unit.MILLIWATT, unitPattern("{0} mW"));
put(Unit.WATT, unitPattern("{0} W"));
put(Unit.HECTOPASCAL, unitPattern("{0} hPa"));
put(Unit.INCH_HG, unitPattern("{0} inHg"));
put(Unit.MILLIBAR, unitPattern("{0} mbar"));
put(Unit.MILLIMETER_OF_MERCURY, unitPattern("{0} mm Hg"));
put(Unit.POUND_PER_SQUARE_INCH, unitPattern("{0} psi"));
put(Unit.KILOMETER_PER_HOUR, unitPattern("{0} km/h"));
put(Unit.KNOT, unitPattern("{0} kn"));
put(Unit.METER_PER_SECOND, unitPattern("{0} m/s"));
put(Unit.MILE_PER_HOUR, unitPattern("{0} mi/h"));
put(Unit.CELSIUS, unitPattern("{0}°C"));
put(Unit.FAHRENHEIT, unitPattern("{0}°F"));
put(Unit.TEMPERATURE_GENERIC, unitPattern("{0}°"));
put(Unit.KELVIN, unitPattern("{0} K"));
put(Unit.ACRE_FOOT, unitPattern("{0} ac ft"));
put(Unit.BUSHEL, unitPattern("{0} bu"));
put(Unit.CENTILITER, unitPattern("{0} cL"));
put(Unit.CUBIC_CENTIMETER, unitPattern("{0} cm³"));
put(Unit.CUBIC_FOOT, unitPattern("{0} ft³"));
put(Unit.CUBIC_INCH, unitPattern("{0} in³"));
put(Unit.CUBIC_KILOMETER, unitPattern("{0} km³"));
put(Unit.CUBIC_METER, unitPattern("{0} m³"));
put(Unit.CUBIC_MILE, unitPattern("{0} mi³"));
put(Unit.CUBIC_YARD, unitPattern("{0} yd³"));
put(Unit.CUP, unitPattern("{0} c"));
put(Unit.CUP_METRIC, unitPattern("{0} mc"));
put(Unit.DECILITER, unitPattern("{0} dL"));
put(Unit.FLUID_OUNCE, unitPattern("{0} fl oz"));
put(Unit.GALLON, unitPattern("{0} gal US"));
put(Unit.GALLON_IMPERIAL, unitPattern("{0} gal Imp."));
put(Unit.HECTOLITER, unitPattern("{0} hL"));
put(Unit.LITER, unitPattern("{0} l"));
put(Unit.MEGALITER, unitPattern("{0} ML"));
put(Unit.MILLILITER, unitPattern("{0} mL"));
put(Unit.PINT, unitPattern("{0} pt"));
put(Unit.PINT_METRIC, unitPattern("{0} mpt"));
put(Unit.QUART, unitPattern("{0} qt"));
put(Unit.TABLESPOON, unitPattern("{0} tbsp"));
put(Unit.TEASPOON, unitPattern("{0} tsp"));
}};
protected static final Map> UNITS_SHORT_OTHER = new EnumMap>(Unit.class) {{
put(Unit.G_FORCE, unitPattern("{0} G"));
put(Unit.METER_PER_SECOND_SQUARED, unitPattern("{0} m/s²"));
put(Unit.ARC_MINUTE, unitPattern("{0}′"));
put(Unit.ARC_SECOND, unitPattern("{0}″"));
put(Unit.DEGREE, unitPattern("{0}°"));
put(Unit.RADIAN, unitPattern("{0} rad"));
put(Unit.REVOLUTION, unitPattern("{0} rev"));
put(Unit.ACRE, unitPattern("{0} ac"));
put(Unit.HECTARE, unitPattern("{0} ha"));
put(Unit.SQUARE_CENTIMETER, unitPattern("{0} cm²"));
put(Unit.SQUARE_FOOT, unitPattern("{0} ft²"));
put(Unit.SQUARE_INCH, unitPattern("{0} in²"));
put(Unit.SQUARE_KILOMETER, unitPattern("{0} km²"));
put(Unit.SQUARE_METER, unitPattern("{0} m²"));
put(Unit.SQUARE_MILE, unitPattern("{0} mi²"));
put(Unit.SQUARE_YARD, unitPattern("{0} yd²"));
put(Unit.KARAT, unitPattern("{0} kt"));
put(Unit.MILLIGRAM_PER_DECILITER, unitPattern("{0} mg/dL"));
put(Unit.MILLIMOLE_PER_LITER, unitPattern("{0} mmol/L"));
put(Unit.PART_PER_MILLION, unitPattern("{0} ppm"));
put(Unit.LITER_PER_100KILOMETERS, unitPattern("{0} L/100km"));
put(Unit.LITER_PER_KILOMETER, unitPattern("{0} L/km"));
put(Unit.MILE_PER_GALLON, unitPattern("{0} mpg US"));
put(Unit.MILE_PER_GALLON_IMPERIAL, unitPattern("{0} mpg Imp."));
put(Unit.BIT, unitPattern("{0} bit"));
put(Unit.BYTE, unitPattern("{0} byte"));
put(Unit.GIGABIT, unitPattern("{0} Gb"));
put(Unit.GIGABYTE, unitPattern("{0} GB"));
put(Unit.KILOBIT, unitPattern("{0} kb"));
put(Unit.KILOBYTE, unitPattern("{0} kB"));
put(Unit.MEGABIT, unitPattern("{0} Mb"));
put(Unit.MEGABYTE, unitPattern("{0} MB"));
put(Unit.TERABIT, unitPattern("{0} Tb"));
put(Unit.TERABYTE, unitPattern("{0} TB"));
put(Unit.CENTURY, unitPattern("{0} c"));
put(Unit.DAY, unitPattern("{0} d"));
put(Unit.HOUR, unitPattern("{0} h"));
put(Unit.MICROSECOND, unitPattern("{0} μs"));
put(Unit.MILLISECOND, unitPattern("{0} ms"));
put(Unit.MINUTE, unitPattern("{0} min"));
put(Unit.MONTH, unitPattern("{0} m"));
put(Unit.NANOSECOND, unitPattern("{0} ns"));
put(Unit.SECOND, unitPattern("{0} s"));
put(Unit.WEEK, unitPattern("{0} w"));
put(Unit.YEAR, unitPattern("{0} y"));
put(Unit.AMPERE, unitPattern("{0} A"));
put(Unit.MILLIAMPERE, unitPattern("{0} mA"));
put(Unit.OHM, unitPattern("{0} Ω"));
put(Unit.VOLT, unitPattern("{0} V"));
put(Unit.CALORIE, unitPattern("{0} cal"));
put(Unit.FOODCALORIE, unitPattern("{0} Cal"));
put(Unit.JOULE, unitPattern("{0} J"));
put(Unit.KILOCALORIE, unitPattern("{0} kcal"));
put(Unit.KILOJOULE, unitPattern("{0} kJ"));
put(Unit.KILOWATT_HOUR, unitPattern("{0} kWh"));
put(Unit.GIGAHERTZ, unitPattern("{0} GHz"));
put(Unit.HERTZ, unitPattern("{0} Hz"));
put(Unit.KILOHERTZ, unitPattern("{0} kHz"));
put(Unit.MEGAHERTZ, unitPattern("{0} MHz"));
put(Unit.ASTRONOMICAL_UNIT, unitPattern("{0} au"));
put(Unit.CENTIMETER, unitPattern("{0} cm"));
put(Unit.DECIMETER, unitPattern("{0} dm"));
put(Unit.FATHOM, unitPattern("{0} fm"));
put(Unit.FOOT, unitPattern("{0} ft"));
put(Unit.FURLONG, unitPattern("{0} fur"));
put(Unit.INCH, unitPattern("{0} in"));
put(Unit.KILOMETER, unitPattern("{0} km"));
put(Unit.LIGHT_YEAR, unitPattern("{0} ly"));
put(Unit.METER, unitPattern("{0} m"));
put(Unit.MICROMETER, unitPattern("{0} µm"));
put(Unit.MILE, unitPattern("{0} mi"));
put(Unit.MILE_SCANDINAVIAN, unitPattern("{0} smi"));
put(Unit.MILLIMETER, unitPattern("{0} mm"));
put(Unit.NANOMETER, unitPattern("{0} nm"));
put(Unit.NAUTICAL_MILE, unitPattern("{0} nmi"));
put(Unit.PARSEC, unitPattern("{0} pc"));
put(Unit.PICOMETER, unitPattern("{0} pm"));
put(Unit.POINT, unitPattern("{0} pt"));
put(Unit.YARD, unitPattern("{0} yd"));
put(Unit.LUX, unitPattern("{0} lx"));
put(Unit.CARAT, unitPattern("{0} CD"));
put(Unit.GRAM, unitPattern("{0} g"));
put(Unit.KILOGRAM, unitPattern("{0} kg"));
put(Unit.METRIC_TON, unitPattern("{0} t"));
put(Unit.MICROGRAM, unitPattern("{0} µg"));
put(Unit.MILLIGRAM, unitPattern("{0} mg"));
put(Unit.OUNCE, unitPattern("{0} oz"));
put(Unit.OUNCE_TROY, unitPattern("{0} oz t"));
put(Unit.POUND, unitPattern("{0} lb"));
put(Unit.STONE, unitPattern("{0} st"));
put(Unit.TON, unitPattern("{0} tn"));
put(Unit.GIGAWATT, unitPattern("{0} GW"));
put(Unit.HORSEPOWER, unitPattern("{0} hp"));
put(Unit.KILOWATT, unitPattern("{0} kW"));
put(Unit.MEGAWATT, unitPattern("{0} MW"));
put(Unit.MILLIWATT, unitPattern("{0} mW"));
put(Unit.WATT, unitPattern("{0} W"));
put(Unit.HECTOPASCAL, unitPattern("{0} hPa"));
put(Unit.INCH_HG, unitPattern("{0} inHg"));
put(Unit.MILLIBAR, unitPattern("{0} mbar"));
put(Unit.MILLIMETER_OF_MERCURY, unitPattern("{0} mm Hg"));
put(Unit.POUND_PER_SQUARE_INCH, unitPattern("{0} psi"));
put(Unit.KILOMETER_PER_HOUR, unitPattern("{0} km/h"));
put(Unit.KNOT, unitPattern("{0} kn"));
put(Unit.METER_PER_SECOND, unitPattern("{0} m/s"));
put(Unit.MILE_PER_HOUR, unitPattern("{0} mi/h"));
put(Unit.CELSIUS, unitPattern("{0}°C"));
put(Unit.FAHRENHEIT, unitPattern("{0}°F"));
put(Unit.TEMPERATURE_GENERIC, unitPattern("{0}°"));
put(Unit.KELVIN, unitPattern("{0} K"));
put(Unit.ACRE_FOOT, unitPattern("{0} ac ft"));
put(Unit.BUSHEL, unitPattern("{0} bu"));
put(Unit.CENTILITER, unitPattern("{0} cL"));
put(Unit.CUBIC_CENTIMETER, unitPattern("{0} cm³"));
put(Unit.CUBIC_FOOT, unitPattern("{0} ft³"));
put(Unit.CUBIC_INCH, unitPattern("{0} in³"));
put(Unit.CUBIC_KILOMETER, unitPattern("{0} km³"));
put(Unit.CUBIC_METER, unitPattern("{0} m³"));
put(Unit.CUBIC_MILE, unitPattern("{0} mi³"));
put(Unit.CUBIC_YARD, unitPattern("{0} yd³"));
put(Unit.CUP, unitPattern("{0} c"));
put(Unit.CUP_METRIC, unitPattern("{0} mc"));
put(Unit.DECILITER, unitPattern("{0} dL"));
put(Unit.FLUID_OUNCE, unitPattern("{0} fl oz"));
put(Unit.GALLON, unitPattern("{0} gal US"));
put(Unit.GALLON_IMPERIAL, unitPattern("{0} gal Imp."));
put(Unit.HECTOLITER, unitPattern("{0} hL"));
put(Unit.LITER, unitPattern("{0} l"));
put(Unit.MEGALITER, unitPattern("{0} ML"));
put(Unit.MILLILITER, unitPattern("{0} mL"));
put(Unit.PINT, unitPattern("{0} pt"));
put(Unit.PINT_METRIC, unitPattern("{0} mpt"));
put(Unit.QUART, unitPattern("{0} qt"));
put(Unit.TABLESPOON, unitPattern("{0} tbsp"));
put(Unit.TEASPOON, unitPattern("{0} tsp"));
}};
public _NumberFormatter_root() {
super(
CLDR.Locale.root,
new _Params(),
// decimal standard
patterns("#,##0.###", "-#,##0.###"),
// percent standard
patterns("#,##0%", "-#,##0%"),
// currency standard
patterns("¤ #,##0.00", "-¤ #,##0.00"),
// currency accounting
patterns("¤ #,##0.00", "-¤ #,##0.00"),
// units standard
patterns("#,##0.#", "-#,##0.#")
);
}
protected int getDivisor_DECIMAL_SHORT(int digits) {
int index = Math.min(14, Math.max(0, digits - 1));
return DECIMAL_SHORT_DIVISORS[index];
}
protected NumberPattern[] getPattern_DECIMAL_SHORT(int digits, PluralCategory category) {
if (category == null) {
category = PluralCategory.OTHER;
}
int index = Math.min(14, Math.max(0, digits - 1));
switch (category) {
case OTHER:
default: return DECIMAL_SHORT_OTHER[index];
}
}
protected int getDivisor_DECIMAL_LONG(int digits) {
int index = Math.min(14, Math.max(0, digits - 1));
return DECIMAL_LONG_DIVISORS[index];
}
protected NumberPattern[] getPattern_DECIMAL_LONG(int digits, PluralCategory category) {
if (category == null) {
category = PluralCategory.OTHER;
}
int index = Math.min(14, Math.max(0, digits - 1));
switch (category) {
case OTHER:
default: return DECIMAL_LONG_OTHER[index];
}
}
protected int getDivisor_CURRENCY_SHORT(int digits) {
int index = Math.min(14, Math.max(0, digits - 1));
return CURRENCY_SHORT_DIVISORS[index];
}
protected NumberPattern[] getPattern_CURRENCY_SHORT(int digits, PluralCategory category) {
if (category == null) {
category = PluralCategory.OTHER;
}
int index = Math.min(14, Math.max(0, digits - 1));
switch (category) {
case OTHER:
default: return CURRENCY_SHORT_OTHER[index];
}
}
protected List getPattern_UNITS_LONG(Unit unit, PluralCategory category) {
if (category == null) {
category = PluralCategory.OTHER;
}
switch (category) {
case OTHER: default: return UNITS_LONG_OTHER.get(unit);
}
}
protected List getPattern_UNITS_NARROW(Unit unit, PluralCategory category) {
if (category == null) {
category = PluralCategory.OTHER;
}
switch (category) {
case OTHER: default: return UNITS_NARROW_OTHER.get(unit);
}
}
protected List getPattern_UNITS_SHORT(Unit unit, PluralCategory category) {
if (category == null) {
category = PluralCategory.OTHER;
}
switch (category) {
case OTHER: default: return UNITS_SHORT_OTHER.get(unit);
}
}
public String getCurrencySymbol(CLDR.Currency code) {
if (code == null) {
return "";
}
switch (code) {
case AUD: return "A$";
case BRL: return "R$";
case CAD: return "CA$";
case CNY: return "CN¥";
case EUR: return "€";
case GBP: return "£";
case HKD: return "HK$";
case ILS: return "₪";
case INR: return "₹";
case JPY: return "JP¥";
case KRW: return "₩";
case MXN: return "MX$";
case NZD: return "NZ$";
case TWD: return "NT$";
case USD: return "US$";
case VND: return "₫";
case XAF: return "FCFA";
case XCD: return "EC$";
case XOF: return "CFA";
case XPF: return "CFPF";
default: return code.name();
}
}
public String getNarrowCurrencySymbol(CLDR.Currency code) {
if (code == null) {
return "";
}
switch (code) {
case AOA: return "Kz";
case ARS: return "$";
case AUD: return "$";
case BAM: return "KM";
case BBD: return "$";
case BDT: return "৳";
case BMD: return "$";
case BND: return "$";
case BOB: return "Bs";
case BRL: return "R$";
case BSD: return "$";
case BWP: return "P";
case BYN: return "р.";
case BZD: return "$";
case CAD: return "$";
case CLP: return "$";
case CNY: return "¥";
case COP: return "$";
case CRC: return "₡";
case CUC: return "$";
case CUP: return "$";
case CZK: return "Kč";
case DKK: return "kr";
case DOP: return "$";
case EGP: return "E£";
case ESP: return "₧";
case EUR: return "€";
case FJD: return "$";
case FKP: return "£";
case GBP: return "£";
case GEL: return "₾";
case GIP: return "£";
case GNF: return "FG";
case GTQ: return "Q";
case GYD: return "$";
case HKD: return "$";
case HNL: return "L";
case HRK: return "kn";
case HUF: return "Ft";
case IDR: return "Rp";
case ILS: return "₪";
case INR: return "₹";
case ISK: return "kr";
case JMD: return "$";
case JPY: return "¥";
case KHR: return "៛";
case KMF: return "CF";
case KPW: return "₩";
case KRW: return "₩";
case KYD: return "$";
case KZT: return "₸";
case LAK: return "₭";
case LBP: return "L£";
case LKR: return "Rs";
case LRD: return "$";
case LTL: return "Lt";
case LVL: return "Ls";
case MGA: return "Ar";
case MMK: return "K";
case MNT: return "₮";
case MUR: return "Rs";
case MXN: return "$";
case MYR: return "RM";
case NAD: return "$";
case NGN: return "₦";
case NIO: return "C$";
case NOK: return "kr";
case NPR: return "Rs";
case NZD: return "$";
case PHP: return "₱";
case PKR: return "Rs";
case PLN: return "zł";
case PYG: return "₲";
case RON: return "lei";
case RUB: return "₽";
case RUR: return "р.";
case RWF: return "RF";
case SBD: return "$";
case SEK: return "kr";
case SGD: return "$";
case SHP: return "£";
case SRD: return "$";
case SSP: return "£";
case STD: return "Db";
case SYP: return "£";
case THB: return "฿";
case TOP: return "T$";
case TRY: return "₺";
case TTD: return "$";
case TWD: return "$";
case UAH: return "₴";
case USD: return "$";
case UYU: return "$";
case VEF: return "Bs";
case VND: return "₫";
case XAF: return "FCFA";
case XCD: return "$";
case XOF: return "CFA";
case XPF: return "CFPF";
case ZAR: return "R";
case ZMW: return "ZK";
default: return code.name();
}
}
public String getCurrencyDisplayName(CLDR.Currency code) {
if (code == null) {
return "";
}
switch (code) {
default: return code.name();
}
}
protected String getCurrencyPluralName(CLDR.Currency code, PluralCategory category) {
switch (code) {
default: return "";
}
}
public int getCurrencyDigits(CLDR.Currency code) {
return _CurrencyUtil.getCurrencyDigits(code);
}
protected void wrapUnits(PluralCategory category, DigitBuffer dbuf, String unit,
StringBuilder dest) {
dbuf.appendTo(dest);
dest.append(" ");
dest.append(unit);
}
private static class _Params extends NumberFormatterParams {
_Params() {
this.decimal = ".";
this.group = ",";
this.percent = "%";
this.minus = "-";
this.plus = "+";
this.exponential = "E";
this.superscriptingExponent = "×";
this.perMille = "‰";
this.infinity = "∞";
this.nan = "NaN";
this.currencyDecimal = ".";
this.currencyGroup = ",";
}
}
}