+1  A: 

As far as I know you need to do that yourself:

Here's some code.

99miles
+1  A: 

Hi there,

here is a quick example, it is pretty straight forward, but let me know if you have any questions.

var n:Number = 999.99123;
var minLength:int = 15;
var s:String = n.toFixed(2);
var diff:int = minLength - s.length;

while (diff > 0) {
    s = '0' + s;
    diff--;
}

trace(s);

EDIT: did you want "tenths" to always be 0?

Tyler Egeto
I tested this code and it did not produce the results the OP asked for. I got results like `3 -> 000000000003.00` and `153 -> 000000000153.00` but it should be `3 -> 0000000.03` and `153 -> 0000001.53`
Sam
This example will format a Number (ie floating point) to 2 decimal places... however VideoDnd's count variable is an integer (which equates to 1/100ths of a second). You could fix this by changing the first line to: var n:Number = count/100;
Richard Inglis
any ideas? I'm kinda stuck.
VideoDnd
+2  A: 

Here's a function to format it the way you want.

function formatCount(i:int):String {

    var fraction:int = i % 100;
    var whole:int = i / 100;

    return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" : "") + fraction;
}

function test():void {
    for (var i:int = 1; i<100000; i += 3) {
        trace(i + " -> " + formatCount(i));
    }
}
]]>

Sample output (spacing added):

1     -> 0000000.01
4     -> 0000000.04
7     -> 0000000.07
10    -> 0000000.10
13    -> 0000000.13
97    -> 0000000.97
100   -> 0000001.00
103   -> 0000001.03
235   -> 0000002.35
520   -> 0000005.20
997   -> 0000009.97
1000  -> 0000010.00
1003  -> 0000010.03
99997 -> 0000999.97
Sam
Nice solution Sam!
Tyler Egeto
Not sure how to apply it, almost out of noobsville. The output show no errors, yet it didn't display. Probally me.
VideoDnd
You'd do something like: `myTextBox.text = formatCount(score);`
Anon.
That makes sense, but I broke it. See above
VideoDnd
A: 

MILLIONS COUNTER WITH ZERO PLACEHOLDERS

//CA, NC, LONDON, ED, GA "increments"
var timer:Timer = new Timer(10);  
var count:int = 0; //start at -1 if you want the first decimal to be 0  
var fcount:int = 0; 

timer.addEventListener(TimerEvent.TIMER, incrementCounter);  
timer.start();  

function incrementCounter(event:TimerEvent) {  
  count++;  
  fcount=int(count*count/10000);//starts out slow... then speeds up 
  mytext.text = formatCount(fcount);
}

function formatCount(i:int):String { 
     var fraction:int = i % 100; 
     var whole:int = i / 100;  

    return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); 
} 
VideoDnd