Package | org.as3utils |
Class | public final class NumberUtil |
Inheritance | NumberUtil Object |
Number
objects.
Method | Defined By | ||
---|---|---|---|
NumberUtil is a static class and shouldn't be instantiated. | NumberUtil | ||
isEven(value:Number):Boolean [static] | NumberUtil | ||
isNotNumber(num:Number):Boolean [static]
Checks if the value of the Number object is NaN(not a number). | NumberUtil | ||
isNumber(num:Number):Boolean [static]
Checks if the value of the Number object is a number. | NumberUtil | ||
isOdd(value:Number):Boolean [static] | NumberUtil | ||
round(num:Number, rounding:NumericRounding):Number [static] | NumberUtil | ||
zeroPrecedent(num:Number, lessThan:Number = 10):String [static] | NumberUtil |
NumberUtil | () | Constructor |
public function NumberUtil()
NumberUtil is a static class and shouldn't be instantiated.
IllegalOperationError — NumberUtil is a static class and shouldn't be instantiated.
|
isEven | () | method |
public static function isEven(value:Number):Boolean
Parameters
value:Number |
Boolean |
isNotNumber | () | method |
public static function isNotNumber(num:Number):Boolean
Checks if the value of the Number
object is NaN(not a number).
This method uses the native AS3 isNaN()
global function
Parameters
num:Number — a Number object to evaluate.
|
Boolean — true if the value is NaN (not a number) and false otherwise.
|
import org.as3coreaddendum.utils.NumberUtil; var num:Number; trace("num: " + num) // NaN NumberUtil.isNotNumber(null) // false NumberUtil.isNotNumber(num) // true NumberUtil.isNotNumber(1) // false NumberUtil.isNotNumber(-1) // false NumberUtil.isNotNumber(NaN) // true
isNumber | () | method |
public static function isNumber(num:Number):Boolean
Checks if the value of the Number
object is a number.
This method uses the native AS3 isNaN()
global function
Parameters
num:Number — a Number object to evaluate.
|
Boolean — true if the value is a number and false if it is NaN (not a number).
|
import org.as3coreaddendum.utils.NumberUtil; var num:Number; trace("num: " + num) // NaN NumberUtil.isNumber(null) // true NumberUtil.isNumber(num) // false NumberUtil.isNumber(1) // true NumberUtil.isNumber(-1) // true NumberUtil.isNumber(NaN) // false
isOdd | () | method |
public static function isOdd(value:Number):Boolean
Parameters
value:Number |
Boolean |
round | () | method |
public static function round(num:Number, rounding:NumericRounding):Number
Parameters
num:Number | |
rounding:NumericRounding |
Number |
zeroPrecedent | () | method |
public static function zeroPrecedent(num:Number, lessThan:Number = 10):String
Parameters
num:Number | |
lessThan:Number (default = 10 )
|
String |