X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/docs/api/Ext.Number.html diff --git a/docs/api/Ext.Number.html b/docs/api/Ext.Number.html new file mode 100644 index 00000000..1dd23913 --- /dev/null +++ b/docs/api/Ext.Number.html @@ -0,0 +1,66 @@ +Ext.Number | Ext JS 4.0 Documentation +
For up to date documentation and features, visit +http://docs.sencha.com/ext-js/4-0

Sencha Documentation

+ + + + + +

A collection of useful static methods to deal with numbers

+
Defined By

Methods

 
constrain( +Number number, Number min, Number max) + : Number
Checks whether or not the current number is within a desired range. If the number is already within the +range it is ...

Checks whether or not the current number is within a desired range. If the number is already within the +range it is returned, otherwise the min or max value is returned depending on which side of the range is +exceeded. Note that this method returns the constrained value but does not change the current number.

+

Parameters

  • number : Number

    The number to check

    +
  • min : Number

    The minimum number in the range

    +
  • max : Number

    The maximum number in the range

    +

Returns

  • Number   

    The constrained value if outside the range, otherwise the current value

    +
 
from( +Mixed value, Number defaultValue) + : Number
Validate that a value is numeric and convert it to a number if necessary. Returns the specified default value if +it i...

Validate that a value is numeric and convert it to a number if necessary. Returns the specified default value if +it is not.

+ +

Ext.Number.from('1.23', 1); // returns 1.23 +Ext.Number.from('abc', 1); // returns 1

+

Parameters

  • value : Mixed
    +
  • defaultValue : Number

    The value to return if the original value is non-numeric

    +

Returns

  • Number   

    value, if numeric, defaultValue otherwise

    +
 
toFixed( +Number value, Number precision) + : void

Formats a number using fixed-point notation

+

Formats a number using fixed-point notation

+

Parameters

  • value : Number

    The number to format

    +
  • precision : Number

    The number of digits to show after the decimal point

    +

Returns

  • void    +
\ No newline at end of file