Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Direct Email
Sub Rect
RADMSAgent
ECD
Blinker
IMS CharacterGenerator Studio
Scroll Up/Down
Closing a MIAW
Robin Hood Xtra
Play Sound of Member
 

 

 

Behavior Pad Number with Zeros

Added on 8/3/2005

 

Compatibilities:
D7 D8 D8_5 D9 Mac PC

This item has not yet been rated

Author: Chunick (website)

This moviescript function will pad the value you send it with up to 15 zeros (well, 14 + 1 digit number). To use, for example: invoiceNum = invoiceNum + 1 member("invoice").text = padZeros(invoiceNum, 8)

on padZeros (theValue, theAmount)
  if theAmount > 15 then return VOID
  temp = the floatPrecision
  the floatPrecision = theAmount
  theString = string(value(theValue) * power(10, -(the floatPrecision)))
  delete char 1 to 2 of theString
  the floatPrecision = temp
  return theString
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail