Formating Number: 9 into 09


/ Published in: ActionScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function formatNumber(aN:String):String {
  2. return (aN.length == 1 ? "0" : "") + aN.substr(0,aN.length - 1) + "" + aN.substr(aN.length-1);
  3. }
  4. trace(formatNumber("9");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.