How to use format-number() function?
-
I'm trying to chop the sig digits of numbers. The numbers are accessed at certain levels down the data structure, e.g. /OverallData/Year/Area/../../Value. It causes error if I use format-number(/OverallData/../../../.., ###.##), how do you do it? Also the number can be an attribute of a node. It's a pretty lazy question, but I'm in a hurry to finish off a task, thanks in advance.
-
I'm trying to chop the sig digits of numbers. The numbers are accessed at certain levels down the data structure, e.g. /OverallData/Year/Area/../../Value. It causes error if I use format-number(/OverallData/../../../.., ###.##), how do you do it? Also the number can be an attribute of a node. It's a pretty lazy question, but I'm in a hurry to finish off a task, thanks in advance.
I never tried it with a full XPath but I think you need to add apostrophs around the format string, e.g.:
<xsl:value-of select="format-number(<XPath>,'###.##&apos)" />
Hope this helps, Bjørn.