|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSimpleTagSupport
AbstractSimpleTag
FormatTag
FormatNumber
public class FormatNumber
A formatter used to format numbers. This formatter uses patterns that conform to
java.text.NumberFormat
pattern syntax. FormatNumber calls toString()
on
the object to be formatted to get the value the pattern is applied to.
The valid FormatNumber types are:
<netui:label value="12345678"> <netui:formatNumber pattern="#,###.00" /> </netui:label>
In the next sample, the value ".33" is formatted to 33%.
<netui:label value=".33"> <netui:formatNumber type="percent" /> </netui:label>
In the next sample, the value "14.317" is formatted to $14.32.
<netui:label value="14.317"> <netui:formatNumber country="US" language="en" type="currency" /> </netui:label>
Nested Class Summary | |
---|---|
static class |
FormatNumber.NumberFormatter
Internal FormatTag.Formatter which uses NumberFormat. |
Nested classes/interfaces inherited from class FormatTag |
---|
FormatTag.Formatter |
Field Summary | |
---|---|
protected String |
_type
The type of number format to be used. |
Fields inherited from class FormatTag |
---|
_pattern |
Constructor Summary | |
---|---|
FormatNumber()
|
Method Summary | |
---|---|
void |
doTag()
Create the internal Formatter instance and perform the formatting. |
String |
getTagName()
Return the name of the Tag. |
void |
setType(String type)
Sets the type of number format to be used (number, currency, or percent). |
Methods inherited from class FormatTag |
---|
getLocale, setCountry, setLanguage, setPattern |
Methods inherited from class AbstractSimpleTag |
---|
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write |
Methods inherited from class SimpleTagSupport |
---|
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String _type
Constructor Detail |
---|
public FormatNumber()
Method Detail |
---|
public String getTagName()
getTagName
in interface INetuiTag
getTagName
in class AbstractSimpleTag
public void setType(String type) throws JspException
type
- - the number format type.
JspException
public void doTag() throws JspException
doTag
in interface SimpleTag
doTag
in class SimpleTagSupport
JspException
- if a JSP exception has occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |