Posted By

weavermedia on 09/13/11


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

weavermedia
fedecp


AS3 Pad an Integer with Specified Number of Zeros


 / Published in: ActionScript 3
 

  1. function padZeros(num:int, digits:int=2):String
  2. {
  3. var s:String = String(num);
  4. while (s.length < digits) {s = "0" + s};
  5. return s;
  6. }

Report this snippet  

You need to login to post a comment.