toBase()

Converts the given number into a string representing the number in the specified base.

This function is valid in v2.12.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{number=} opt_num Optional
The number that should be represented in a specific base.
{number} base
A number in the range from 2 to 36.

Returns

{string|Function}
If only one argument is given a partial function will be returned which will take that original argument as base, will accept one argument when called which will be interpreted as the number to convert to the specified base. Otherwise converts the first arguments to the specified base and returns the number as a string.