actionscript - Flex NumericStepper: limit range of integer part before the decimal point -


i have numericstepper in flex must accept values between 0 , 999.99.

i tried setting numericstepper follows:

    <s:numericstepper id="numstepper" value="@{myvalue}" maximum="999.99" snapinterval="0.01" stepsize="0.01" minimum="0"/> 

and setting numbervalidator attached it:

var nvalidator:numbervalidator = new numbervalidator(); nvalidator.source = numstepper; nvalidator.precision = 2; numericstepper.maxchars=6; nvalidator.decimalseparator="."; 

the thing works directly limit user input via keyboard in numeric stepper, user can't type things "1.4567" 1.45.

so want limit integer , decimal part of number according specifications:

  1. max 3 chars integer part
  2. "." decimal separator
  3. max 2 chars precision

maybe regular expression can help?

thanks

have tried...

nvalidator.fractionaldigits = 2; 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -