For the complete documentation index, see llms.txt. This page is also available as Markdown.

FormatBaseN

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

Method Signature

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

Arguments

Argument
Type
Required
Description
Default

number

numeric

true

The number to convert to the specified base.

radix

integerTruncate

true

The base to convert the number to, in the range 2-36.

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?