FormatBaseN

Converts a number to a string representation in the specified base.

Method Signature

FormatBaseN(number=[numeric], radix=[integer])

Arguments

Argument
Type
Required
Description
Default

number

numeric

true

radix

integer

true

Examples

Format 10 as dual number

Run Example

formatBaseN( 10, 2 );

Result: 1010

Format 1024 as hexadecimal number

Run Example

Result: 400

Format 125 as decimal number

Run Example

Result: 125

Format a float

Floors float to integer then formats with radix given

Run Example

Result: 1010

Additional Examples

Last updated

Was this helpful?