xsl-list
[Top] [All Lists]

Re: [xsl] Format Phone number

2009-12-21 06:32:07
The javadoc for java.text.DecimalFormat which is explicitly referred
to by the XSLT 1.0 spec contains this paragraph - note the last
sentence:

<quote>
The grouping separator is commonly used for thousands, but in some
countries it separates ten-thousands. The grouping size is a constant
number of digits between the grouping characters, such as 3 for
100,000,000 or 4 for 1,0000,0000. If you supply a pattern with
multiple grouping characters, the interval between the last one and
the end of the integer is the one that is used. So "#,##,###,####" ==
"######,####" == "##,####,####".
</quote>

XSLT 2.0 defines format-number without such a reference, which
explains the difference.

I'd prefer substring and concatenation functions for creating the
999-999-9999 pattern.
-W


On Mon, Dec 21, 2009 at 11:36 AM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
wrote:


thanks for your response. this is returing me  xx-xxxx-xxxx
format not xxx-xxx-xxxx.

what could be the issue.

That looks like a bug in your XSLT processor.

(But this is not the way I would recommend tackling this problem).

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>