-----Ursprüngliche Nachricht-----
Von: Clay Leeds [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 6. Mai 2004 18:09
An: [EMAIL PROTECTED]
Betreff: Re: formatted numbers
not exactly. I dont want to format the number, I want to format the output
of the number. In my example (sorry, it was messed up) I wanted to show
output centered by the point. I dont have to format currency output, but
numbers that might have a different decippoint length. So the opportunity to
center the output on the point would be great. 
Numbers lie "1", 1.00056", "77656.4" etc. may be part of the output.

Jan Kohnert wrote:
> Hello List,
> 
> is it possible to output formatted numbers using FOP?
> For Example centered by the decimalpoint?
> 
> like:
>    78.00
>  123.00
>      0.99
This is more of an XSL question, but I think what you want is:

Currency ($) version we use:

<fo:table-cell text-align="right" margin-top="1pt">
   <fo:block font-weight="bold" padding-top="2pt">
     <xsl:value-of select="format-number(AMOUNT,'$,###.00')"/>
   </fo:block>
</fo:table-cell>

Here's a link with more useful info I found on Google ("xsl format-number"):

http://www.w3schools.com/xsl/func_formatnumber.asp

Here's how I use format-number() to calculate the margin-top of 
fo:region-body (and extent of fo:region-before) to create a dynamically 
sized fo:region-before:

<xsl:attribute name="margin-top"><xsl:value-of 
select="format-number($varHeaderMinHeight_DEFAULT+(8*$varLineHeight_DEFAULT)
+.1,'#.00')"/><xsl:value-of 
select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>

Hope this helps!

Web Maestro Clay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to