The Common-Controls Tag Library

<convert:convertNumber>

Register a NumberConverter instance on the UIComponent associated with the closest parent UIComponent custom action.
must be nested within a ConversionSupportTag

Tag class: ConvertNumberTag
Tei class: ConverterTei
 

[ Syntax ]

Standard Syntax
<convert:convertNumber
[ currencyCode = "String" ]
[ currencySymbol = "String" ]
[ groupingUsed = "String" ]
[ integerOnly = "String" ]
[ locale = "String" ]
[ maxFractionDigits = "String" ]
[ maxIntegerDigits = "String" ]
[ minFractionDigits = "String" ]
[ minIntegerDigits = "String" ]
[ pattern = "String" ]
[ type = "String" ]
/>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
currencyCodeString ISO 4217 currency code, applied only when formatting currencies.  
currencySymbolString Currency symbol, applied only when formatting currencies.  
groupingUsedString Flag specifying whether formatted output will contain grouping separators. Expressions must evaluate to a boolean. Default value is true.  
integerOnlyString Flag specifying whether only the integer part of the value will be formatted and parsed. Expressions must evaluate to a boolean. Default value is false.  
localeString Locale whose predefined styles for numbers are used during formatting and parsing. If not specified, the Locale returned by RequestContext.getLocale() will be used. Expressions must evaluate to a java.util.Locale.  
maxFractionDigitsString Maximum number of digits that will be formatted in the fractional portion of the output. Expressions must evaluate to an int.  
maxIntegerDigitsString Maximum number of digits that will be formatted in the integer portion of the output. Expressions must evaluate to an int.  
minFractionDigitsString Minimum number of digits that will be formatted in the fractional portion of the output. Expressions must evaluate to an int.  
minIntegerDigitsString Minimum number of digits that will be formatted in the integer portion of the output. Expressions must evaluate to an int.  
patternString Custom formatting pattern which determins how the number string should be formatted and parsed.  
typeString Specifies how the number string will be formatted and parsed. Valid values are "number", "currency", and "percentage". Default value is "number".  

[ Example ]

Usage of a a NumberConverter


<%@ taglib uri="http://struts.apache.org/tags-html"               prefix="html" %>
<%@ taglib uri="http://www.common-controls.com/cc/tags-forms"      prefix="forms" %>
<%@ taglib uri="http://www.common-controls.com/cc/tags-converter"   prefix="convert" %>

<html:form action="/sample809/converterdemo">

   <forms:form 
      type="edit"
      caption="converter.examples.caption" 
      formid="frmEdit" 
      width="550"  
      help="HID-100">


      <forms:text  
         label="form.convert.convertNumber"  
         property="currency" 
         size="20" 
         maxlength="20" 
         required="true"  
         help="HID-101">


         <convert:convertNumber groupingUsed="true" minFractionDigits="2"/>
      </forms:text>

      <forms:buttonsection default="btnSave">
         <forms:button  name="btnSave"    text="button.title.save"    title="button.title.save"/>
      </forms:buttonsection>
   </forms:form>

</html:form>