Sorry but this is my 1st attempt @ actionscript and I've yet to find a really good reference and training is weeks away. I'm using Flex Builder 3 and trying to create a percentage based on current month sales vs prior month sales and avoiding zero divide for entities with no prior month sales but it isn't compiling, the relevant code is:
private function formatCMCPct(item:Object, column

ataGridColumn) :String {return fmtCMCPct.format(if(item.PMC == 0) {0;}
else {(item.CMC/item.PMC)*100;}) + "%"; }
<mx:NumberFormatter id="fmtCMCPct" precision="0" useThousandsSeparator="true" useNegativeSign="true"/>
When I first tried simply (item.CMC/item.PMC)*100 it worked except for the zero divide rows. The error is as follows:
1083: Syntax error: else is expected
1084: Syntax error: expecting identifier before if
1084: Syntax error: expecting identifier before rightparen
1084: Syntax error: expecting rightparen before leftbrace
1086: Syntax error: expecting semicolon before leftbrace
Thanks!