formatBaseN

String Converts number to a string, in the base specified by radix.

formatBaseN(number, radix) → returns string

formatBaseN Argument Reference

number numeric
Required

radix numeric
Required

Examples sample code invoking the formatBaseN function

formatBaseN(10,2)

Expected Result: 1010

formatBaseN(1024,16)

Expected Result: 400

formatBaseN(125,10)

Expected Result: 125

Floors float to integer then formats with radix given

formatBaseN(10.75,2)

Expected Result: 1010


Fork me on GitHub