I'm using XSL 2.0. I have the following $intTOTAL which I'm converting to milliseconds. But the output of this is in scentific notation. How do i convert this to a normal number without scientific notation
<xsl:variable name="intTotal" select="((number($timeINTSEC)*60)*1000 + number($timeINTMSEC))"/>
<TEST><xsl:value-of select="number($intTotal)"/></TEST>
Here is the output i'm getting
<TEST>1.14E6</TEST>
Expanding Martin's comment, the
number()function converts to anxs:double, and the default output format forxs:doubleis scientific notation for values outside the range 1e-6 to 1e6.You could either do the arithmetic in
xs:decimalinstead ofxs:double, by using thexs:decimal()function in place ofnumber(), or you could override the wayxs:doublevalues are formatted by using theformat-number()function.Incidentally the call to
number()innumber($intTotal)is redundant because the value is already anxs:double. And it's always a good idea to declare the types of your variables with anasattribute so it's clear to the reader what's going on.