Helmut Granda
learning through interaction
Mar 7th
Posted by Helmut Granda in ActionScript
ActionScript:
function formatDecimals2 (num, digits) {
if (num < 0 ) {
num = 0;
}
if (digits <= 0) {
return Math.round(num);
}
var tenToPower = Math.pow(10, digits);
var cropped = String(Math.round(num * tenToPower) / tenToPower);
trace(”digits:” + digits + ” – ” + cropped);
}
formatDecimals2( 35435.234234, 2);
formatDecimals2( 35435.234234, 3);
formatDecimals2( 35435.234234, 4);
Time to go pick up a SXSW interactive badge.
do quite a bit of "scratch" math Now I have the perfect tool for it SOULVER! http://bit.ly/4SFYz (via stevensacks)
@maninboxuk is that the emergency word? Is some one else monitoring his vitals in case he can't even saythose words?
RT @ryancarson: Made me chuckle: Comic Sans walks into a bar and the barman says, "We don't serve your type here." #tv
@juniesauce you found a bug with it? I just dont like the idea of having that option. Specially while working with teams.
@squaredeye what a boring game. haha maybe I dont have appreciation for fonts :)
@smithandrobot I say skip it all together, the more risk the more betterer