Examples of toPattern()


Examples of com.ibm.icu.text.DecimalFormat.toPattern()

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormat.toPattern()'
     */
    public void testToPattern() {
        DecimalFormat df = new DecimalFormat("#,##0.##");
        assertEquals("#,##0.##", df.toPattern());
    }

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormat.toLocalizedPattern()'
     */
 
View Full Code Here

Examples of com.ibm.icu.text.MessageFormat.toPattern()

     * MessageFormat.toPattern has weird rounding behavior.
     */
    public void Test4058973() {

        MessageFormat fmt = new MessageFormat("{0,choice,0#no files|1#one file|1< {0,number,integer} files}");
        String pat = fmt.toPattern();
        if (!pat.equals("{0,choice,0.0#no files|1.0#one file|1.0< {0,number,integer} files}")) {
            errln("MessageFormat.toPattern failed");
        }
    }
    /* @bug 4031438
View Full Code Here

Examples of com.ibm.icu.text.SimpleDateFormat.toPattern()

        assertEquals("modified format: MMMddHmm", "14. von Oktober 8:58", format.format(sampleDate));

        // get a pattern and modify it
        format = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locale);
        format.setTimeZone(zone);
        String pattern = format.toPattern();
        assertEquals("full-date", "Donnerstag, 14. Oktober 1999 08:58:59 Mitteleurop\u00E4ische Sommerzeit", format.format(sampleDate));

        // modify it to change the zone.
        String newPattern = gen.replaceFieldTypes(pattern, "vvvv");
        format.applyPattern(newPattern);
View Full Code Here

Examples of com.ibm.icu.text.UnicodeSet.toPattern()

                            "Empty Property-Value in: " + s + "\r\nUse "
                                    + showSet(prop.getAvailableValues()));
                }
                if (DEBUG)
                    System.out.println("\t(" + prefix + ")Returning "
                            + set.toPattern(true));
                return set.toPattern(true).toCharArray(); // really ugly
            }

            private String showSet(List list) {
                StringBuffer result = new StringBuffer("[");
View Full Code Here

Examples of java.text.ChoiceFormat.toPattern()

     */
    public void Test4106661()
    {
        ChoiceFormat fmt = new ChoiceFormat(
          "-1#are negative| 0#are no or fraction | 1#is one |1.0<is 1+ |2#are two |2<are more than 2.");
        logln("Formatter Pattern : " + fmt.toPattern());

        logln("Format with -INF : " + fmt.format(Double.NEGATIVE_INFINITY));
        logln("Format with -1.0 : " + fmt.format(-1.0));
        logln("Format with 0 : " + fmt.format(0));
        logln("Format with 0.9 : " + fmt.format(0.9));
View Full Code Here

Examples of java.text.DecimalFormat.toPattern()

  {
    final SimpleDateFormat dfmt = new SimpleDateFormat("");
    System.out.println(dfmt.toPattern());

    final DecimalFormat dcfmt = new DecimalFormat(DECIMALFORMAT_DEFAULT_PATTERN);
    System.out.println(dcfmt.toPattern());

    testSerialization(dfmt);
    testSerialization(dcfmt);
  }
}
View Full Code Here

Examples of java.text.DecimalFormat.toPattern()

      throws ObjectFactoryException
  {
    super.setParameterFromObject(o);
    final DecimalFormat format = (DecimalFormat) o;
    //setParameter("localizedPattern", format.toLocalizedPattern());
    setParameter("pattern", format.toPattern());
  }

  /**
   * Creates an object (<code>DecimalFormat</code>) based on this description.
   *
 
View Full Code Here

Examples of java.text.DecimalFormat.toPattern()

      {
        final NumberFormat format = NumberFormat.getCurrencyInstance(context.getLocale());
        if (format instanceof DecimalFormat)
        {
          final DecimalFormat decimalFormat = (DecimalFormat) format;
          return decimalFormat.toPattern();
        }
      }

      final DecimalFormat format = new DecimalFormat();
      if (scale != null && precision != null)
View Full Code Here

Examples of java.text.DecimalFormat.toPattern()

        format.setMaximumFractionDigits(scale.intValue());
        format.setMinimumFractionDigits(scale.intValue());
        format.setMaximumIntegerDigits(precision.intValue() - scale.intValue());
        format.setMinimumIntegerDigits(1);
      }
      return format.toPattern();
    }
    return null;
  }

  public static boolean isIgnorable(final DataAttributes attributes,
View Full Code Here

Examples of java.text.DecimalFormat.toPattern()

  public String getFormatString()
  {
    if (getFormat() instanceof DecimalFormat)
    {
      final DecimalFormat decFormat = (DecimalFormat) getFormat();
      return decFormat.toPattern();
    }
    return null;
  }

  /**
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.