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:
- max 3 chars integer part
- "." decimal separator
- max 2 chars precision
maybe regular expression can help?
thanks
have tried...
nvalidator.fractionaldigits = 2;
Comments
Post a Comment