Posted By

barigazy on 07/17/12


Tagged


Versions (?)

DECIMAL PADDING


 / Published in: Maxscript
 

Add decimal padding

  1. fn addDecimalPadding nr =
  2. (
  3. case of (
  4. (nr < 10): ("00" + nr as string)
  5. (nr > 9 and nr < 100): ("0" + nr as string)
  6. (nr > 99): (nr as string)
  7. )
  8. )
  9. addDecimalPadding 15
  10. -->"015"

Report this snippet  

You need to login to post a comment.