0 Replies Latest reply on Oct 18, 2006 4:50 AM by AnnieK

    CurrencyFormatter class


      I am passing a number to a formatter method, it works OK for all number unless the number is negative and less than 1, it then returns a different number:


      public static function currencyFormat( numIn : Number ) : String
      var fmt_USD : CurrencyFormatter = new CurrencyFormatter();
      fmt_USD.rounding = 'none';
      fmt_USD.precision = 2;
      fmt_USD.currencySymbol = "$";
      fmt_USD.useThousandsSeparator = true;
      fmt_USD.alignSymbol = "left";
      fmt_USD.useNegativeSign = true;

      var strAmountFormatted : String = fmt_USD.format( numIn );

      return strAmountFormatted;

      If I pass 0.63 into the method above it returns $.63
      If I pass -0.63 into the method above it returns -$.37

      Do you know if this is an existing bug or am I doing something wrong?

      PS. using the NumberFormatter class works OK for the scenarios above.