开发者

displaying precision value.... in flex text box

in my flex application im retrieving a data from database..... (ie开发者_StackOverflow) price as decimal(18,4)...

Now i need to display the retrieved value in an flex text box

textbox name is price.text... obj is object name...

i have used the following in code...it not works...

    price.text = obj.Price.toPrecision((18,4));

.kindly give ur suggestions folks....


Take a look at the NumberFormatter. To follow your example, you would declare a NumberFormatter like so:

<mx:NumberFormatter
    id="myNumberFormatter"
    precision="4"/> 

or in Actionscript:

var myNumberFormatter:NumberFormatter = new NumberFormatter;
myNumberFormatter.precision = 4;

Then use the NumberFormatter's format function on your value:

price.text = myNumberFormatter.format(obj.Price);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜