tags:

views:

209

answers:

1

hi how can i insert a currency symbol in the jsf page with precision of 2 digits

i am using the following libs

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/WEB-INF/oasis.tld" prefix="oasis"%>

but if i use the following libs :

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:f="http://java.sun.com/jsf/core" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:hx="http://www.ibm.com/jsf/html_extended"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:oasis="/WEB-INF/oasis.tld">

this tag is working

<f:convertNumber type="currency" currencySymbol="$" maxFractionDigits="2" minFractionDigits="2"/>

but if i use the first libs this tag is not working

can any one tell me how to insert a currency symbol and precision of 2 digits by using first libs

+1  A: 

Did you try the <f:convertNumber/> component?

<h:outputText value="#{myBean.myAmount}">
    <f:convertNumber minFractionDigits="2" maxFractionDigits="2" currencySymbol="XXX"/>
</h:outputText>

(where XXX is your currency symbol)

romaintaz
Ok, I posted this before editing your question, so maybe it is not what you are looking for...
romaintaz