                               minimum :
                               maximum;
     	widestNumber += stepSize;
-    	return widestNumber.toString().length;
+    	
+    	if (displayFormatFunction != null)
+    	    return displayFormatFunction(widestNumber).length;
+    	else 
+    	   return widestNumber.toString().length;
+    }
+    
+    /**
+     *  @private
+     *  Helper method that applies the displayFormatFunction  
+     */
+    private function applyDisplayFormatFunction():void
+    {
+        if (displayFormatFunction != null)
+            textInput.text = displayFormatFunction(value);
+        else
+            textInput.text = value.toString();
     }
     
     //--------------------------------------------------------------------------

    override public function setFocus():void
    {
        if (stage)
            stage.focus = textInput.textView;
    }
    
    /**

        
        invalidateProperties();
    }
    
    //--------------------------------- 
    // displayFormatFunction
    //---------------------------------

    private var _displayFormatFunction:Function;
    private var displayFormatFunctionChanged:Boolean;
    
     /**
     *  Callback function that formats the value displayed
     *  in the textInput field.
     *  The function takes a single Number as an argument
     *  and returns a formatted String.
     *
     *  <p>The function has the following signature:</p>
     *  <pre>
     *  funcName(value:Number):String
     *  </pre>
     
     *  @default undefined   
     */
    public function get displayFormatFunction():Function
    {
        return _displayFormatFunction;
    }
    
    /**
     *  @private
     */
    public function set displayFormatFunction(value:Function):void
    {
        _displayFormatFunction = value;
        
        displayFormatFunctionChanged = true;
        
        invalidateProperties();
    }

    //--------------------------------------------------------------------------
    //
