A number input is a special kind of text input that only accepts numbers. The
type of number it accepts is specified by its NumberInput.inputType
.
See also:
Static variables
staticfinalread onlyREG_FLOAT:EReg = ~/^[\-\+]?[0-9]+(\.[0-9]+)?$/
The regular expression used to check whether a string is a valid
signed floating point number. Note that the decimal separator is a
decimal point(.
) as it is common in the English language.
It also accepts strings beginning with a +
or -
sign.
See also:
staticfinalread onlyREG_INT:EReg = ~/^[\-\+]?[0-9]+$/
The regular expression used to check whether a string is a valid signed integer number.
It also accepts strings beginning with a +
or -
sign.
See also:
staticfinalread onlyREG_UNSIGNED_FLOAT:EReg = ~/^[\+?[0-9]+(\.[0-9]+)?$/
The regular expression used to check whether a string is a valid
unsigned floating point number. Note that the decimal separator is a
decimal point(.
) as it is common in the English language.
It also accepts strings beginning with a +
sign.
See also:
staticfinalread onlyREG_UNSIGNED_INT:EReg = ~/^\+?[0-9]+$/
The regular expression used to check whether a string is a valid unsigned integer number.
It also accepts strings beginning with a +
sign.
See also:
Constructor
Variables
Methods
getFloatValue():Float
Return the floating point value of this element. If the input is
invalid, Math.NaN
is returned. This function is equivalent to
getFloatValueOrDefault(Math.NaN)
.
See also:
getFloatValueOrDefault(defaultValue:Float = 0.0):Float
Return the floating point value of this element. If the input is invalid, the given default value is returned.
See also:
getIntValue():Null<Int>
Return the integer value of this element. If the input is invalid,
null
is returned (make sure to test this in your code!).
See also:
getIntValueOrDefault(defaultValue:Int = 0):Int
Return the integer value of this element. If the input is invalid, the given default value is returned.
See also:
setFloatValue(value:Null<Float>):Void
Set the floating point value of this element. If this number input
accepts integer vaues only, the decimal places of the given value are
truncated towards zero. If the given value is not a finite number
(Math.NaN
, Math.POSIIVE_INIFINITY
etc.) or null
(possible on
non-static targets only), nothing will happen.
setIntValue(value:Null<Int>):Void
Set the integer value of this element. If the given value is null
(possible on non-static targets only), nothing will happen.
Parameters:
value | The new value |
---|