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

RE: format-number() for a phone number?

Subject: RE: format-number() for a phone number?
From: "Cote, Stephane" <scote@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 May 1999 15:24:09 -0700
decimalformat phone number
Title: RE: format-number() for a phone number?

Just use

        formatNumber(phonenumberhere,"(###)###-####");

I just tried it.

Stef

    -----Original Message-----
    From:   Mike Brown [SMTP:mbrown@xxxxxxxxxxxxx]
    Sent:   Tuesday, May 25, 1999 2:33 PM
    To:     'xsl-list@xxxxxxxxxxxxxxxx'
    Subject:        format-number() for a phone number?

    I need to format North American phone numbers that are 10 digits, like:

    <phone>3035551212</phone>

    would become

    (303) 555-1212

    My understanding from looking at the list archives is that there is no
    consensus
    things like length(phone) and substring(phone,0,3) are not possible with
    XSLT at
    this time, due to unresolved issues about characters vs bytes.

    Is it possible to use the format-number() function to achieve this kind of
    formatting? I can't deduce how to use format-number() at all, really. The
    spec
    points to JDK documentation for DecimalFormat, but the example in that doc
    is
    not terribly helpful.

    Any help appreciated.



     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-2013 All Rights Reserved.