XSLT format-number() Function
Complete XSLT Function Reference
Definition and Usage
The format-number() function is used to convert a number into a string.
Syntax
string format-number(number,format,[decimalformat])
|
Parameters
| Parameter |
Description |
| number |
Required. Specifies the number to be formatted |
| format |
Required. Specifies the format pattern. Here are some of
the characters used in the formatting pattern:
- # (Denotes a digit. Example: ####)
- 0 (Denotes leading and following zeros. Example: 0000.00)
- . (The position of the decimal point Example: ###.##)
- , (The group separator
for thousands. Example: ###,###.##)
- % (Displays the number as a percentage. Example: ##%)
- ; (Pattern separator. The first pattern will be used for positive numbers
and the second for negative numbers)
|
| decimalformat |
Optional. |
Example 1
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:value-of select='format-number(500100, "#.00")' />
<br />
<xsl:value-of select='format-number(500100, "#.0")' />
<br />
<xsl:value-of select='format-number(500100, "###,###.00")' />
<br />
<xsl:value-of select='format-number(0.23456, "##%")' />
<br />
<xsl:value-of select='format-number(500100, "#######")' />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
View the XSL file and
View the result.
Complete XSLT Function Reference
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |

|
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |

|
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Promote collaboration among coworkers in your organization through project workspaces where others can efficiently find information and work together |

|
Personalize your company profile by bookmarking and organizing favorite content, uploading assets, posting photos, blogging, and more |

|
Interact with features like tagging, flagging, wikis and ratings found in the Web 2.0 Toolbox |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide. Request an
INSTANT DEMO or download a
FREE TRIAL today. |
|