Function in conv coil-stdlib

int_to_dec

fn int_to_dec(int n) -> string
Import
use conv::{int_to_dec};
Source: src/conv.hy

Formats n in decimal; the same as format("%i", n).

Parameters#

NameType
nint

Returns#

string

Examples#

use conv::{int_to_dec};
use tests::assert;
assert!(int_to_dec(-42) == "-42");

See also#

  • int_to_hex: Formats n in lowercase hexadecimal without a prefix; a negative n gets a leading -.
  • int_to_bin: Formats n in binary without a prefix; a negative n gets a leading -.
  • parse_int_radix: Parses an integer written in base radix, which must be 10 or 16.
  • parse_int: Parses a decimal integer, such as "42", " -7 " or "+3".
  • parse_float: Parses a decimal float such as "3.5", "-0.25", "1e3" or "42".
↑ ↓ navigate ↵ open