             if (validChars.indexOf(c) == -1)
             {
                 results.push(new ValidationResult(
-					true, baseField, "invalidChar",
-					validator.invalidCharError));
-				return results;
+                    true, baseField, "invalidChar",
+                    validator.invalidCharError));
+                return results;
             }
         }
 

            decimalSeparator.length != 1 ||
            thousandsSeparator.length != 1)
        {
			results.push(new ValidationResult(
				true, baseField, "invalidFormatChar",
				validator.invalidFormatCharsError));
			return results;
        }

        // Check for invalid characters in input.
        var validChars:String = 
        	DECIMAL_DIGITS + NEGATIVE_FORMATTING_CHARS +
			currencySymbol + decimalSeparator + thousandsSeparator;
        for (i = 0; i < len; i++)
        {
            c = input.charAt(i);

 */
public class CurrencyValidator extends Validator
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  Formatting characters for negative values.
     */
    private static const NEGATIVE_FORMATTING_CHARS:String = "-()";

    //--------------------------------------------------------------------------
    //
    //  Class methods
    //
    //--------------------------------------------------------------------------

    /**
     *  Convenience method for calling a validator.
     *  Each of the standard Flex validators has a similar convenience method.
     *
     *  @param validator The CurrencyValidator instance.
     *
     *  @param value The object to validate.
     *
     *  @param baseField Text representation of the subfield
     *  specified in the <code>value</code> parameter.
     *  For example, if the <code>value</code> parameter specifies value.currency,
     *  the baseField value is "currency".
     *
     *  @return An Array of ValidationResult objects, with one ValidationResult 
     *  object for each field examined by the validator. 
     *
     *  @see mx.validators.ValidationResult
     */
    public static function validateCurrency(validator:CurrencyValidator,
                                            value:Object,
                                            baseField:String):Array
    {
        var results:Array = [];
        
        // Resource-backed properties of the validator.
        var alignSymbol:String = validator.alignSymbol;
        var allowNegative:Boolean = validator.allowNegative;        
        var currencySymbol:String = validator.currencySymbol;
        var decimalSeparator:String = validator.decimalSeparator;
        var maxValue:Number = Number(validator.maxValue);
        var minValue:Number = Number(validator.minValue);
        var precision:int = int(validator.precision);
        var thousandsSeparator:String = validator.thousandsSeparator;

        var input:String = String(value);
        var len:int = input.length;
        
        var isNegative:Boolean = false;
        
        var i:int;
        var c:String;

        // Make sure the formatting character parameters are unique,
        // are not digits or negative formatting characters,
        // and that the separators are one character.
        var invalidFormChars:String = DECIMAL_DIGITS + NEGATIVE_FORMATTING_CHARS;

        if (currencySymbol == thousandsSeparator ||
