formatNumber"

From Documentation
(Created page with "{{ZUMLReferencePageHeader}} The default method: <source lang="java"> String formatNumber (Object number, String pattern); </source> :i.e., <javadoc method="formatNumber (java....")
 
Line 4: Line 4:
  
 
<source lang="java">
 
<source lang="java">
String formatNumber (Object number, String pattern);
+
String formatNumber(Object number, String pattern);
 
</source>
 
</source>
  
:i.e., <javadoc method="formatNumber (java.lang.Object, java.lang.String)">org.zkoss.xel.fn.CommonFns</javadoc>
+
:i.e., <javadoc method="formatNumber(java.lang.Object, java.lang.String)">org.zkoss.xel.fn.CommonFns</javadoc>
  
 
Formats a number (Integer, BigDecimal...) into a string with the given pattern.
 
Formats a number (Integer, BigDecimal...) into a string with the given pattern.
Line 14: Line 14:
  
 
<source lang="java">
 
<source lang="java">
String formatNumber (Object number, String pattern, Locale locale);
+
String formatNumber(Object number, String pattern, Locale locale);
 
</source>
 
</source>
  
:i.e., <javadoc method="formatNumber (java.lang.Object, java.lang.String, java.util.Locale)">org.zkoss.xel.fn.CommonFns</javadoc>
+
:i.e., <javadoc method="formatNumber(java.lang.Object, java.lang.String, java.util.Locale)">org.zkoss.xel.fn.CommonFns</javadoc>
  
 
Formats a number (Integer, BigDecimal...) into a string with the given pattern and locale.
 
Formats a number (Integer, BigDecimal...) into a string with the given pattern and locale.

Revision as of 07:03, 30 April 2012

The default method:

String formatNumber(Object number, String pattern);
i.e., CommonFns.formatNumber(Object, String)

Formats a number (Integer, BigDecimal...) into a string with the given pattern.

There is another extended built in function,

String formatNumber(Object number, String pattern, Locale locale);
i.e., CommonFns.formatNumber(Object, String, Locale)

Formats a number (Integer, BigDecimal...) into a string with the given pattern and locale.

You can define a method to use this function by xel-method


Parameters: In both default and extended function:

  • number - the Number to format
  • pattern - the pattern to apply

In extended function only:

  • locale - the locale to apply

Version History

Last Update : 2012/04/30


Version Date Content
6.0.1    



Last Update : 2012/04/30

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.