flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurice Amsellem <maurice.amsel...@systar.com>
Subject RE: Data type to convert and store a srting into decimal/float value
Date Wed, 26 Feb 2014 12:45:03 GMT
>From the code you sent:
 You are already converting the data to float in the list,

So the second parseFloat in the labelFunction is superfluous and will cause the app to crash.
You should do:
 return  Number(item[column.dataField] ).toFixed(2);


-----Message d'origine-----
De : Ash1703 [mailto:ashish.yadav@firmwisegroup.com] 
Envoyé : mercredi 26 février 2014 13:39
À : users@flex.apache.org
Objet : RE: Data type to convert and store a srting into decimal/float value

for each(var obj:Object in xml received from backend){					
list.addItem({activeper:parseFloat(obj.activeper)});}

grid.dataprovider = above list ;


private function theLabelFunction(item:Object,column:DataGridColumn):String{
var num:Number = parseFloat(item[column.dataField]);
return num.toFixed(2);}


Itemrender is used for comparing the column value with 10 and text color is changed depending
upon the value...thats it..!!

The itemrender is defined in the mx:tag.

Does it helps??



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Data-type-to-convert-and-store-a-srting-into-decimal-float-value-tp5202p5219.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message