title: ActionScript - Formatting Zero With NumberFormatter?
body: <p>i've assigned properties to a NumberFormatter object so that formatted values contain a leading zero, trailing zeros and a 2 decimal places.</p>
  
  <p>the formatting works unless the number being formatted is 0.  how can i format a 0 with the set properties so that 0 becomes 0.00?</p>
  
  <pre><code>var numFormat:NumberFormatter = new NumberFormatter(LocaleID.DEFAULT);
  numFormat.leadingZero = true;
  numFormat.trailingZeros = true;
  numFormat.fractionalDigits = 2;
  
  trace(numFormat.formatNumber(46));      //46.00
  trace(numFormat.formatNumber(0.556849));  //0.56
  trace(numFormat.formatNumber(0));        //0
  </code></pre>
  
  <hr>
  
  <p><strong>[EDIT]</strong>
  i've remedied this problem by manually appending the locale decimal separator with the desired number of fractionalDigits if the formatted number is 0:</p>
  
  <pre><code>if (myFormattedNumber.text == "0" &amp;&amp; numFormat.fractionalDigits)
     {
     myFormattedNumber.appendText(numFormat.decimalSeparator);
  
     for (var i:uint = 0; i &lt; numFormat.fractionalDigits; i++)
         myFormattedNumber.appendText("0");
     }
  </code></pre>
  
  <p>i'm still very interested in knowing if this is a bug or a feature, but it seems like a oversight to me.</p>