actionscript-3 - 弹性数字格式

标签 actionscript-3 apache-flex

我想以印度格式格式化一个数字。

例如,

x= 123456 应格式化为
1,23,456。

我怎样才能在 flex 中做到这一点?

谢谢,

最佳答案

使用数字格式化程序。

<mx:NumberFormatter id="myFormatter"
    decimalSeparatorFrom="."
    decimalSeparatorTo="."
    precision="-1"
    rounding="none"
    thousandsSeparatorFrom=","
    thousandsSeparatorTo=","
    useNegativeSign="true"
    useThousandsSeparator="true"/>

ActionScript 代码
x = myFormatter.format(x);

关于actionscript-3 - 弹性数字格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1119136/

相关文章:

apache-flex - Actionscript 3 自省(introspection)——函数名称

flash - 在 AIR/AS3 中复制 MovieClip

RegEx 未找到所有匹配项

javascript - flash:ExternalInterface 适用于嵌入标签,但不适用于对象标签

actionscript-3 - 防止 Flex 树掉落反馈

actionscript-3 - 静态 ActionScript 代码分析的可能性

actionscript-3 - 闪光灯:crossdomain.xml 被忽略

flash - 在 Ubuntu 中构建 MediaElement flash 组件

c# - 将数据发布到 Flex/Flash (mxml) 应用程序

image - 如何在 Flex/Spark TextArea 或 TextFlow 中的特定位置添加图像