Function num_digitize::digitize [] [src]

pub fn digitize<N: Copy + Clone + Integer + DivAssign>(number: N) -> Vec<N>

Converts integer of type N (all implementations supported by num::Integer) and returns a Vec<N> of its digits (base 10).

Arguments

  • number - any number type which have implementation for num::Integer

Example

use num_digitize::digitize;

let number: u8 = 12;
assert!(digitize(number) == vec![1, 2]);