PERGOLA LOGO

Number

Number prototype extension methods.

prototype

evenToOdd()

Returns the integer one smaller than this, if this is even, or this.

oddToEven()

Returns the integer one smaller than this, if this is odd, or this.

isEven()

Returns true if this is even, or false.

isInteger()

Returns true if this is an integer, or false.

trim(p)

p number specifies the number of decimal places; if omitted, pergola.decimals is used; returns this with p decimal places (rounded).

toRad()

Converts this degrees to radians.

toDeg()

Converts this radians to degrees.