top

NUMBER

** This class will not be supported in 2015.

   All functionalities of Number class are more improved, integrating with CAPH. Therefore Number class is not supported since 2015 Smart TV. To use functions of Number class, refer to here.


This class defines the Number functions. Defines the Number formatting.

Add the following line for Number class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/af/2.0.0/loader.js">/script>

You can declare Number class like this :

  ex) var number = 6;


Methods

addZeros

Description
This function adds number "0" to the beginning of number object.
Parameters
■length
  - Length
  - Length of string to get.
Return■String
  - Zero added number. 
   * (e.g) Like '02' for number 2 with length 2.
Emulator SupportN
SDK ConstraintNone
Example
var num = (2).addZeros(3); // num is '002'

addTh

Description
this function adds a ordinal string - "st", "nd", "rd" and "th" - to the end of number object.
Parameters
none
Return■String
  - Generated string from the number.
   * (e.g) Like '1st', '5th'.
Emulator SupportN
SDK ConstraintNone
Example
var a = (2).addTh(); // a is '2nd'