use std::fmt::Display;
use crate::stringable_to_digits;
pub trait Digits: Display {
fn digits(&self) -> Box<[u8]> {
unsafe { stringable_to_digits(self) }
}
}
pub trait FloatDigits {
fn digits_left_of_dot(&self) -> Box<[u8]>;
fn digits_right_of_dot(&self) -> Box<[u8]>;
fn digits_left_then_right_of_dot(&self) -> [Box<[u8]>; 2] {
[self.digits_left_of_dot(), self.digits_right_of_dot()]
}
}