|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: format-number usage on international platform
Hi Nuri,
> BUT I know on Xalan 1.2.2 the comma worked correctly in that it
> meant to use the thousands separator of the platform and not literal
> meaning.
The meaning of characters in the format pattern you give as the second
argument to format-number() (e.g. '0', '#', ',', '.') are defined by a
decimal format. If you don't give a third argument for the
format-number() function then it should interpret the format pattern
according to the default decimal format. The default decimal format
defines a ',' (comma) as the grouping separator and a '.' (period) as
the decimal separator.
So whatever platform you're on, whatever internationalisation settings
you've got set, if you do:
format-number(1234, '#,##0')
you should get '1,234'.
If you want to use different separators in a number, then you have to
*both* change the format pattern that you use as the second argument
of format-number() *and* change the decimal format that it uses. For
example, you could define a Turkish decimal format:
<xsl:decimal-format name="Turkish"
grouping-separator="." />
and then call format-number() explicitly referencing that decimal
format:
format-number(1234, '#.##0', 'Turkish')
to get '1.234'.
Alternatively, you could redeclare the default decimal format to use
whatever separators you like:
<xsl:decimal-format grouping-separator="." />
in which case you don't need to use the third argument for
format-number() to get the Turkish formatting.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








