Namespace: numbers

core. numbers

The core.numbers package is a modular JavaScript library that provides extra Number methods and implementations.

Author:
License:

Methods


toInt(num)

Transform a float number into this integer representation.

Parameters:
Name Type Description
num number

The number to transform in an integer numeric value.

Returns:

The integer representation of the specific value.

Example
trace( toInt(0) ) ; // 0trace( toInt(10) ) ; // 10trace( toInt(10.123) ) ; // 10trace( toInt(-10.123) ) ; // -10

toUint(num)

Transform a float number into this upper integer representation.

Parameters:
Name Type Description
num number

The number to transform in an upper integer numeric value.

Returns:

The upper integer representation of the specific numeric value.

Example
trace( toUint(0) ) ; // 0trace( toUint(10) ) ; // 10trace( toUint(10.123) ) ; // 10trace( toUint(-10.123) ) ; // 10

toUnicodeNotation(num)

Returns the unicode string notation of the specified numeric value.

Parameters:
Name Type Description
num number

The number to transform in a unicode string.

Returns:

The unicode string notation of the specified numeric value.

Example
trace( toUnicodeNotation(  0) ) ; // "0000"trace( toUnicodeNotation( 10) ) ; // "000a"trace( toUnicodeNotation( 15) ) ; // "000f"trace( toUnicodeNotation( 16) ) ; // "0010"trace( toUnicodeNotation(255) ) ; // "00ff"