Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Round Off Number in XSLT?

Status
Not open for further replies.

Yaz22

Programmer
Mar 1, 2012
2
0
0
PH
Hello,
I'm currently having this problem on how to round off the numbers into two decimal places. Im currently using this format:

<xsl:value-of select="format-number($vColumn2Data,'#.##')"/>

Where vColumn2Data has a value of 547645.6739999999 .
The format im using can round off value when its whole number doesnt go upper hundreds.
ex: 567.56789999, it output this way: 567.57

But when the value has a whole number reaching thousands or higher, it doesnt convert at all.
ex: 547645.6739999999, it still output this way: 547645.6739999999 or just a plain text 'NaN'.

Can anyone help me how to solve this?
Thank you. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top