Skip to content

Instantly share code, notes, and snippets.

@nowri
Created September 7, 2012 08:34
Show Gist options
  • Save nowri/3664370 to your computer and use it in GitHub Desktop.
Save nowri/3664370 to your computer and use it in GitHub Desktop.
数字の桁ごと切り出し
var number:Number = 123;
var n100:int;
var n10:int;
var n0:int;
n100 = Math.floor(number/100);
n10 = Math.floor(number/10)%10;
n0 = number%100%10;
trace(n100, n10, n0);
// 1, 2, 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment