Number Methods:
object.nameOfTheMethod(argument);
Methods:
Number.parseInt();
Number.parseFloat();
Number.is?();
variable.toString()
variable.toFixed(n)
Parses a "string"
and returns a whole number:
Number.parseInt("1");
Number.parseInt("3.14");
Number.parseInt("Hello");
Parses a "string"
and returns a floating point number
:
Number.parseFloat("1");
Number.parseFloat("3.14");
Number.parseFloat("Hello");
Checks if type is a number or not. Boolean result: True = number. False = not a number.:
Number.isFinite(123);
Number.isFinite("123");
Number.isInteger(3);
Number.isInteger(3.14);
Number.isInteger("3.14");
Number.isNaN(3);
Number.isNaN("3");
Number.isNaN("Hello");
Parses an integer into a "string"
:
1.toString();
variable.toString();
variable.toString(base#);
Parses a floating point number
into a "string"
:
3.1415926.toFixed(0);
3.1415926.toFixed(4);
3.1415926.toFixed(10);