XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (569 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
9.58Mb size Format: txt, pdf, ePub
per-mille

Multiplies by 1000 and shows it as per mille

The original JDK 1.1 implementation had the feature (I use the term politely) that if there was an explicit negative subpicture, it served to specify the negative prefix and suffix only; the number of digits, grouping separators, and other characteristics were all taken from the positive subpicture, and any specification to the contrary in the negative subpicture was ignored. This curiosity was not actually documented in the JDK 1.1 specification, though it was retained (and documented) in JDK 1.2. Since XSLT 1.0 referred explicitly to the JDK 1.1 specification (but not to the JDK 1.1 implementation), it's likely that some XSLT 1.0 processors share this behavior and others do not. XSLT 2.0 does away with it: all aspects of formatting for a negative number depend on the negative subpicture alone.

In the fractional part of the number, a
0
means you will get a digit in that position whatever its value, while a
#
means you will get a digit only if it is non-zero. You will never get more digits displayed than there are
0
and
#
signs. For example,
.00##
displays a minimum of two and a maximum of four digits after the decimal point. If there are more significant digits in the number than you have asked to be displayed, then the number is rounded. It is rounded to the nearest value that can be displayed, and if it is midway between two such values, it is rounded to the one whose last digit is even. For example, with a picture of
0.00
, the value 0.125 is shown as
0.12

Other books

A Hard Man to Love by Delaney Diamond
Let's Play in the Garden by Grover, John
Passionate Harvest by Nell Dixon
The Stars Came Back by Rolf Nelson
Faithful by Louise Bay
Devil Water by Anya Seton
El caballero del jubón amarillo by Arturo Pérez-Reverte
Elohim III: The Return by Barger, Kerry