弹性数字格式 [英] Flex Number Format
本文介绍了弹性数字格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想以印度格式格式化一个数字.
I want to format a number in indian format.
例如
x= 123456 应该被格式化为1,23,456.
x= 123456 should be formatted as 1,23,456.
我如何在 flex 中做到这一点?
How can i do it in flex?
谢谢,
推荐答案
使用 numberformatter.
Use the numberformatter.
<mx:NumberFormatter id="myFormatter"
decimalSeparatorFrom="."
decimalSeparatorTo="."
precision="-1"
rounding="none"
thousandsSeparatorFrom=","
thousandsSeparatorTo=","
useNegativeSign="true"
useThousandsSeparator="true"/>
动作脚本代码
x = myFormatter.format(x);
这篇关于弹性数字格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文