SplitScript reference / Integer / toString

Integer.toString

Method

T.toString(radix: u32) -> String! where T: Integer

Formats this integer using a positional numeral system.

Radices from 2 through 36 are supported. Digits above nine use lowercase ASCII letters. Signed values keep a leading minus sign and format their mathematical magnitude, including the minimum value of a signed integer type. Use toAsciiUpperCase on the result when uppercase digits are desired. An unsupported radix returns an error.

Parameters

  • radix: The numeral-system radix, from 2 through 36 inclusive.

Effects: allocates

Runtime behavior: available everywhere; synchronous

Examples

Format a hexadecimal identifier

let cellId = 0x00abcdefu32
let hexadecimal = cellId.toString(16) else ""