And a follow up, this works to round numbers with the NumberFormatter
without using the NumberFormatter MXML tag:
function round2(num, precision) {
var result:String;
var formatter = new mx.formatters.NumberFormatter;
formatter.precision = 2;
result = formatter.format(num);
return Number(result);
}
hth,
matt
________________________________
From: Tom Fitzpatrick [mailto:[EMAIL PROTECTED]
Sent: Friday, February 11, 2005 12:55 PM
To: [email protected]
Subject: [flexcoders] percentage value precision
I'm using a display function to show percentage values in a pie
chart
(thanks to the earlier suggestion from this list), as follows:
function display(data, field, index, percentValue) {
return data.Expense + ": " + percentValue + "%";
}
Now what I'd like to do is have the percentValue returned with a
precision
of only two points past the decimal. I can set this up with a
NumberFormatter, but what is the syntax for putting it into action?
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=1298ffmdd/M=298184.6018725.7038619.3001176/D=gr
oups/S=1705007207:HM/EXP=1108230988/A=2532114/R=2/SIG=12kilmrh2/*http://clk.
atdmt.com/NFX/go/yhxxxnfx0020000014nfx/direct/01/&time=1108144588679737>
<http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
:HM/A=2532114/rand=263825610>
________________________________
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .