如何将数字格式化为任意数量的小数位

时间:2023-01-14 16:55:05

Im quite new to XSLT and looking at the decimal-format function im still having trouble trying to format a passed in amount to X decimal places?

我对XSLT很新,看着十进制格式函数,我仍然无法将传入的数量格式化为X小数位?

Can anyone help me with this?

谁能帮我这个?

Thanks

谢谢

<xsl:template match="AverageQuote">
<xsl:value-of select='format-number( ?????? , "###,###.000000")'/>

Where ive put the question marks im trying to pass in the value of the context node (AverageQuote) . I tried '.' and [.] but i cannot get the correct syntax.

我把问号放在哪里试图传递上下文节点的值(AverageQuote)。我试过了 '。'和[。]但我无法得到正确的语法。

1 个解决方案

#1


1  

Try . instead of '.' that is, just a dot, nothing more:

试试。代替 '。'也就是说,只是一个点,仅此而已:

<xsl:value-of select="format-number(., '###,###.000000')" />

#1


1  

Try . instead of '.' that is, just a dot, nothing more:

试试。代替 '。'也就是说,只是一个点,仅此而已:

<xsl:value-of select="format-number(., '###,###.000000')" />