Search in sources :

Example 1 with RuleBasedNumberFormat

use of android.icu.text.RuleBasedNumberFormat in project j2objc by google.

the class RbnfRoundTripTest method TestEnglishSpelloutRT.

/**
 * Perform an exhaustive round-trip test on the English spellout rules
 */
@Test
public void TestEnglishSpelloutRT() {
    RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(Locale.US, RuleBasedNumberFormat.SPELLOUT);
    doTest(formatter, -12345678, 12345678);
}
Also used : RuleBasedNumberFormat(android.icu.text.RuleBasedNumberFormat) Test(org.junit.Test)

Example 2 with RuleBasedNumberFormat

use of android.icu.text.RuleBasedNumberFormat in project j2objc by google.

the class RbnfRoundTripTest method TestRussianSpelloutRT.

/**
 * Perform an exhaustive round-trip test on the Russian spellout rules
 */
@Test
public void TestRussianSpelloutRT() {
    RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(new Locale("ru", "RU", ""), RuleBasedNumberFormat.SPELLOUT);
    doTest(formatter, 0, 12345678);
}
Also used : Locale(java.util.Locale) RuleBasedNumberFormat(android.icu.text.RuleBasedNumberFormat) Test(org.junit.Test)

Example 3 with RuleBasedNumberFormat

use of android.icu.text.RuleBasedNumberFormat in project j2objc by google.

the class RbnfRoundTripTest method TestJapaneseSpelloutRT.

/**
 * Perform an exhaustive round-trip test on the Japanese spellout rules
 */
@Test
public void TestJapaneseSpelloutRT() {
    RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(Locale.JAPAN, RuleBasedNumberFormat.SPELLOUT);
    doTest(formatter, 0, 12345678);
}
Also used : RuleBasedNumberFormat(android.icu.text.RuleBasedNumberFormat) Test(org.junit.Test)

Example 4 with RuleBasedNumberFormat

use of android.icu.text.RuleBasedNumberFormat in project j2objc by google.

the class RbnfRoundTripTest method TestHebrewNumberingRT.

/**
 * Perform an exhaustive round-trip test on the Greek spellout rules
 */
@Test
public void TestHebrewNumberingRT() {
    RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(new Locale("he", "IL", ""), RuleBasedNumberFormat.NUMBERING_SYSTEM);
    formatter.setDefaultRuleSet("%hebrew");
    doTest(formatter, 0, 12345678);
}
Also used : Locale(java.util.Locale) RuleBasedNumberFormat(android.icu.text.RuleBasedNumberFormat) Test(org.junit.Test)

Example 5 with RuleBasedNumberFormat

use of android.icu.text.RuleBasedNumberFormat in project j2objc by google.

the class RbnfRoundTripTest method TestDutchSpelloutRT.

/**
 * Perform an exhaustive round-trip test on the Dutch spellout rules
 */
@Test
public void TestDutchSpelloutRT() {
    RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(new Locale("nl", "NL", ""), RuleBasedNumberFormat.SPELLOUT);
    doTest(formatter, -12345678, 12345678);
}
Also used : Locale(java.util.Locale) RuleBasedNumberFormat(android.icu.text.RuleBasedNumberFormat) Test(org.junit.Test)

Aggregations

RuleBasedNumberFormat (android.icu.text.RuleBasedNumberFormat)55 Test (org.junit.Test)52 ULocale (android.icu.util.ULocale)14 Locale (java.util.Locale)14 ParseException (java.text.ParseException)8 NumberFormat (android.icu.text.NumberFormat)3 BigDecimal (android.icu.math.BigDecimal)2 DecimalFormatSymbols (android.icu.text.DecimalFormatSymbols)2 DisplayContext (android.icu.text.DisplayContext)2 Random (java.util.Random)2 DecimalFormat (android.icu.text.DecimalFormat)1 BigInteger (java.math.BigInteger)1 FieldPosition (java.text.FieldPosition)1 NumberFormat (java.text.NumberFormat)1