XSL 与区域化/国际化数字格式 [英] XSL vs Regionalisation/Internationalization Number Formats
问题描述
在格式化数字时,XSL 中是否内置了任何区域化支持?
Is there any regionalisation support built into XSL when it comes to formatting numbers?
目前我的基础 XML 包含英国/美国格式的数字,例如 54321.12345.我可以对此进行选择总和,以相同格式给我一个总数.我可以使用 format-number(54321.12345, '###,###.#####') 格式化数字给我 54,321.12345.
At present my underlying XML contains numbers in UK/US format, for example 54321.12345. I can do a select sum on this to give me a total in the same format. I can format the number using format-number(54321.12345, '###,###.#####') to give me 54,321.12345.
但是,当我希望它在我的机器上的不同区域设置上运行时,例如逗号分隔符为."的中欧国家/地区.和小数分隔符为,"我想以这种方式格式化我的数字给我 54.321,12345.
However when I want this to run on a different region setting on my machine such as Central European countries which have the comma seperator as "." and the decimal seperator as "," I want to format my numbers in this way to give me 54.321,12345.
在 XSL 中有没有很好的方法来做到这一点?
Is there a nice way to do this in XSL?
谢谢,
安德斯
推荐答案
来自 http:///www.w3.org/TR/xslt#format-number
xsl:decimal-format
元素声明一个十进制格式,它控制一个解释使用的格式模式format-number
函数.
The
xsl:decimal-format
element declares a decimal-format, which controls the interpretation of a format pattern used by theformat-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 />
这篇关于XSL 与区域化/国际化数字格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!