DECIMAL PADDING


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

Add decimal padding


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.