pub struct DecimalFormatF64(pub usize, pub usize, pub f64);Expand description
This struct allows you to print a specific number of digits before the decimal point, and after the decimal point.
This exists because the base format trait allows you to specify a width and a precision. However, in a fractional number, the width applies to the WHOLE number, including the fractional component, and doesn’t zero-pad effectively.
- The first parameter is the number of zero-padded digits before the decimal point.
- The second parameter is the number of zero-padded digits after the decimal point.
§Example:
use irox_tools::fmt::DecimalFormatF64;
assert_eq!("00.1235", format!("{}", DecimalFormatF64(2,4,0.1234567)));Tuple Fields§
§0: usize§1: usize§2: f64Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecimalFormatF64
impl RefUnwindSafe for DecimalFormatF64
impl Send for DecimalFormatF64
impl Sync for DecimalFormatF64
impl Unpin for DecimalFormatF64
impl UnwindSafe for DecimalFormatF64
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more