[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

number formatting according to locale

Subject: number formatting according to locale
From: "Russ Holmes" <rholmes@xxxxxxxxx>
Date: Thu, 31 Aug 2000 10:29:55 +1200
javascript locale number format
I need to format numbers in an xml file according to the locale of the web
server.

E.g. XML;

<ANumber>1234.56</ANumber>

Output from US server;

1,234.56

..from French Server;

1.234,56

I need one XSL style sheet which will do the transformation on the Client,
so using the regional settings of the client machine wouldn't work, I've
thought of maybe passing the locale of the server in the XML, which the XSL
would then use to determine the formatting..

e.g..In  XML

...
<Locale>US</Locale>
..

or

<Locale>FR</Locale>

..but then I don't know how I'd use that to do the formatting.

Guess I could create templates for each possible locale, but the seems a bit
clunky...

I've tried sending the bstrFormat for the formatnumber method in the xml.


e.g..

<Format>###,###,###0.00</Format>

..but the commas and points only indicate the presence of a thousands
divider and a decimal divider, the actual character is determined by the
regional settings of the machine on which the transformation is taking
place.

Any help greatly appreciated.

Russ













 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.