actionscript 3 - How to transform seconds in minutes ? in Flex -
my problems have value...75 seconds , want display in grid 1:15 minutes... how can ?
i'm trying this...
xmlcttsemacao = new xmllistcollection(event.result..ctt); var i:int = 0; each(var node:xml in xmlcttsemacao) { xmlcttsemacao[i].@dur_ctt = (xmlcttsemacao[i].@dur_ctt / 60) %60; i++; } xmlcttsemacao.refresh(); gp2.refresh();
but result example is: 1:25
another example...56 seconds displaying 0.933333
first, split bit, calculate seconds , minutes before putting them together:
for each(var node:xml in xmlcttsemacao) { var durctt:int = xmlcttsemacao[i].@dur_ctt; var seconds:int = durctt % 60; var minutes:int = durctt / 60; var timedisplay:string = minutes + ":" + seconds; xmlcttsemacao[i].@dur_ctt = timedisplay; i++; }
Comments
Post a Comment