well, adding the following method works (but not with the NumberFormatter):
...
return data.Expense + newline + round(percentValue,2) + "%";
...
function round( num, precision ) {
num = "" + num
var fullNum = "" + Math.round( num* Math.pow( 10, precision ) );
var decPoint = fullNum.length - precision;
var result;
if( decPoint != 0 )
{
result = fullNum.substring( 0, decPoint );
result += ".";
result += fullNum.substring( decPoint, fullNum.length );
}
else
{
result = fullNum;
}
return Number( result );
}
The function "round" was lifted entirely (and unchanged) from an
ActionScript blog that I googled on:
http://dev.flashorb.com/blog/archive/2005/01/03/191.aspx
hth,
matt h
________________________________
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/> .