Search in sources :

Example 46 with RuleBasedNumberFormat

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

the class RbnfRoundTripTest method TestFrenchSpelloutRT.

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

Example 47 with RuleBasedNumberFormat

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

the class RbnfRoundTripTest method TestSwedishSpelloutRT.

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

Example 48 with RuleBasedNumberFormat

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

the class RbnfRoundTripTest method TestDurationsRT.

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

Example 49 with RuleBasedNumberFormat

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

the class RbnfRoundTripTest method TestGermanSpelloutRT.

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

Example 50 with RuleBasedNumberFormat

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

the class RbnfRoundTripTest method TestSpanishSpelloutRT.

/**
 * Perform an exhaustive round-trip test on the Spanish spellout rules
 */
@Test
public void TestSpanishSpelloutRT() {
    RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(new Locale("es", "es", ""), 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