Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / October 2008



Tip: Looking for answers? Try searching our database.

leading zeros in dynamic text fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
logeye - 06 Oct 2008 18:45 GMT
I have a dynamic text field that indicates the degree of rotation of a knob. I
need the display to have three digits showing at all times.  This means I need
leading zeros from 0 to 99.  ie, 000, 001, 002, etc.

Is there a way to do this numerically or do I have to change the numbers to
strings and concatenate??

Thanks,
Rothrock - 07 Oct 2008 04:22 GMT
Yes, for the most part only strings can start with leading zeros.

You might run into some troubles because Flash treats a leading zero as a sign
that a number is octal, base-8.

So if you were planning on using Number() to cast your values into numbers,
don't! Instead use parseInt(someString,10).
logeye - 07 Oct 2008 13:30 GMT
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.