formatBaseN

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

formatBaseN(number, radix) → returns string

Argument Reference

number numeric
Required

The number to convert

radix numeric
Required

The base radix to use

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

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub