Re: Currency format in a PDF - another question concerning cents portion

Hi,

> So, I have to manipulate this code in such a way that instead of
> displaying ,45 or .45,
> it should display 0,45 or 0.45 but 0 should not be appended in case when
> unit price
> is like 1.26 or 3.45..etc etc. How can incorporate this condition in the
> above code?

Try to use the following instructions to format the number is the way you
described (note that the decimal format must be declared only once!!):

<xsl:decimal-format name="us" decimal-separator="." grouping-separator=","/>
...
<xsl:value-of select="format-number(put-your-number-here, '#,##0.00',
'us')"/>

Perhaps you should have a look at the documentation of the decimal-format,
format-number (http://www.w3.org/TR/xslt#function-format-number) and syntax
of the format string
(http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html) to know
what you are doing...

Regards,
Daniel

-- 
View this message in context: http://www.nabble.com/Currency-format-in-a-PDF-tp17425898p20832573.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.

Received on Thursday, 4 December 2008 12:39:54 UTC