Link to home
Start Free TrialLog in
Avatar of grexx
grexx

asked on

[XSLT] Format number like 123.456,78 (use comma for decimals and point for thousands)

We use a different notation for numbers. The comma is used for decimals, the point for thousands, like #.###,00. If I use this with format-number in XSL-FO, FOP generates an error. I get an error as well when using XSLT to generate HTML. I wonder whether this is possible at all?
ASKER CERTIFIED SOLUTION
Avatar of Greybird
Greybird

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of grexx
grexx

ASKER

Thanks! (The xsl:decimal-format needs to be top level.)
Avatar of Gertone (Geert Bormans)
you need to give the format-number() function a third argument,
which is a string, name of a <xsl:decimal-format> element (top-level)

eg. <xsl:decimal-format name="myDecFormat"  decimal-separator="," grouping-separator="."/>

then format-number(1228.3, '#.###,00', 'myDecFormat')

cheers
well,
ignore my post,
did not see it was answered yet