XSL vs Regionalisation/Internationalization Number Formats

北慕城南 提交于 2019-12-01 23:10:28

From http://www.w3.org/TR/xslt#format-number

The xsl:decimal-format element declares a decimal-format, which controls the interpretation of a format pattern used by the format-number function.

<!-- Category: top-level-element -->
<xsl:decimal-format
  name = qname 
  decimal-separator = char 
  grouping-separator = char 
  infinity = string 
  minus-sign = char 
  NaN = string 
  percent = char 
  per-mille = char 
  zero-digit = char 
  digit = char 
  pattern-separator = char />

I now have the following xsl:

<!-- define number format to use -->
<xsl:decimal-format name="european" decimal-separator=',' grouping-separator='.' />

<!-- format the number -->
<xsl:value-of select="format-number(54321.12345,'###.##0,0000', 'european')"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!