Reputation: 5165
In xslt when I divide numbers, like
<xsl:value-of select="number( $field ) div number( $factor )"/>
result value can contain E (10 power) like 8.004091E9
How to make it return proper value => 8004091000
without E
s ?
Upvotes: 1
Views: 1354
Reputation: 163458
In XSLT 1.0, the output should never be in scientific notation, so I assume you are using XSLT 2.0.
In XSLT 2.0, the output should be in scientific notation if (a) it's a float or double, (b) its absolute value is outside the range 1e-6 to 1e+6.
One way to avoid getting output in scientific notation is to format it using format-number().
Another way is to avoid floating point: for example, in place of
<xsl:value-of select="number( $field ) div number( $factor )"/>
use
<xsl:value-of select="xs:decimal( $field ) div xs:decimal( $factor )"/>
Upvotes: 2