Skip to content
Mak Sò edited this page Mar 22, 2015 · 1 revision

Number prototypes

  • formatMoney(decimals)

    Convert integer o float number in a money value

    1000000.12.formatMoney(2)

    result

    "1,000,000.12"

  • getSecond(hours,minutes,seconds)

    Return seconds

    Number().getSecond(1,1,1)

    result

    3661

  • getMilliSecond(hours,minutes,seconds)

    Return milliseconds

    Number().getMilliSecond(1,1,1)

    result

    3661000

  • isEven

    Check is the number is even

    var n = 124;

    n.isEven()

    result

    true