Skip to main content

to_base

Function to_base 

Source
pub fn to_base(n: u64, base: u32) -> String
Expand description

Convert n to a string in the given base (2-36).

ยงExamples

use mathverse_core::integer::to_base;

assert_eq!(to_base(255, 16), "ff");
assert_eq!(to_base(10, 2), "1010");