HomeManualTopicsTypesSymbols

std::oct

converts a positive integer value into a string consisting of octal digits

Parameters

val
the value to convert
size (default: undefined)
the optional minimum length

Result

string
a string consisting of octal digits

Description

The optional second parameter specifies the minimum length of the resulting string. If there are fewer octal digits than the specified length, the string is left-padded with zeros.

Example

println! oct(123)

Output

173

Example

println! oct(123 4)

Output

0173

Topics

Math

Strings

See also

std::bin converts a positive integer value into a string consisting of binary digits
std::hex converts a positive integer value into a string consisting of hexadecimal digits
std::to_string returns a human readable presentation of the object