Crates.io | ufloat |
lib.rs | ufloat |
version | 0.1.0 |
source | src |
created_at | 2024-11-23 04:04:51.928439 |
updated_at | 2024-11-23 04:04:51.928439 |
description | Wrappers around floating point numbers with ufmt trait implementations |
homepage | |
repository | https://github.com/LiamGallagher737/ufloat |
max_upload_size | |
id | 1458226 |
size | 9,661 |
Formatting a float is now as easy as wrapping it in either the Uf32
or Uf64
struct with the number of decimal places to format to.
use ufloat::{Uf32, Uf64};
// Format to 3 decimal places.
let a = Uf32(123.456, 3);
// Format to 5 decimal places.
let b = Uf64(123.45678, 5);
The libm
crate is used for math operations.