Subject: Re: [xsl] XPath 1.0: sum() and precision From: Michael Kay <mike@xxxxxxxxxxxx> Date: Fri, 28 Sep 2012 00:16:14 +0100 |
Andrew Welch wrote:
Hi,
I guess if you are stuck with xpath 1.0 it would have to be substring... (or split on the ., then round() on the first 3 digits eg the 490)Thanks Andrew. That's what I thought too, but I wanted to avoid string functions for that purpose. What I've done in the meantime is replacing sum(...) by:
round(sum(...) * 100) div 100
that is, "moving the dot right", rounding as an integer, then "moving the dot left" again.
Michael Kay Saxonica
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath 1.0: sum() and prec, David Carlisle | Thread | [xsl][xslt v1.0] How to parse the s, Mak Praveen |
Re: [xsl] XPath 1.0: sum() and prec, David Carlisle | Date | Re: [xsl] fo:multi-switch or altern, Jesper Tverskov |
Month |