使用 XSLT 格式化 XML 中的数字 [英] Format numbers in XML using XSLT

查看:37
本文介绍了使用 XSLT 格式化 XML 中的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的输入 xml 文件中有一个数字,例如 0.20,但我想通过 xslt 在我的输出 xml 文件中更改为 0,20(逗号而不是点).我怎样才能格式化这个数字?我不想为此使用任何模板.

I have one number in my input xml file like this 0.20 but I want to change to 0,20(comma instead of dot) in my output xml file through xslt. How can I format this number? I don't want to use any templates for it.

推荐答案

使用 format-number($x, '0.00', 'european')

结合

<xsl:decimal-format name="european" decimal-separator="," grouping-separator="."/>

这篇关于使用 XSLT 格式化 XML 中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆