Other Entries

Log

Numbers with Leading Zeroes in Actionscript

Actionscript has an undocumented (at least as far as I can tell) “feature” that causes numbers beginning with the character “0” and consisting of digits all less than 8 to be treated as octals (base-8 numbers). This is actually consistent with javascript’s function, so I guess it wouldn’t be completely undocumented.

The solution is to use parseInt(num, 10), which converts it to a base-10 number. Seems odd that it would default to this behavior without escaping.

Here’s an example of it in action:

08/03/04 04:40PM Flash Geekiness

Recently Played on iTunes

  1. “Abierto”
    Soul Food Taqueria
    Tommy Guerrero
    10/06/08 16:28
  2. “Hit Or Miss”
    Punk Rock Days: The Best Of DBL
    Down By Law
    10/06/08 16:25
  3. “Start!”
    Compact Snap
    The Jam
    10/06/08 16:22

Last 100 Songs >