For this XSLT:
<xsl:variable name="source0" select="number(num2)"/>
<xsl:variable name="source1" select="number(num3)"/>
s0 plain: <xsl:value-of select="$source0"/>
s1 plain: <xsl:value-of select="$source1"/>
test11: <xsl:value-of select="format-number($source0, '#.#')"/>
test12: <xsl:value-of select="format-number($source0, '#.###############')"/>
test21: <xsl:value-of select="format-number($source1, '#.#')"/>
test22: <xsl:value-of select="format-number($source1, '#.###############')"/>
For XML:
<num2>123456.1234</num2>
<num3>1234567.1234</num3>
I get this output (using Saxon 9.2, XSLT 2.0)
s0 plain: 123456.1234
s1 plain: 1.2345671234E6
test11: 123456.1
test12: 123456.123399999996764
test21: 1234567.1
test22: 1234567.123399999924004
First off... I'm curious why does it suddenly switch between standard and scientific notation when it exceeds 6 digits to the left of decimal place? This is my problem, I want to avoid scientific notation. After various other questions, I discover apparently I'm stuck with putting format-number everywhere.
But format-number doesn't appear to work either. In spite of the fact that the output of "s1 plain" proves that the number of significant digits is known to the processor (I understand about converting to double and back can lose precision, but there is the correct number after such a conversion, so...?), there appears to be no way to output that value in standard non-scientific notation. Is there?