Debian Codegraph @

examples/custom_options.rs

raw symbols SCIP
1 extern crate humansize;
2 use humansize::{format_size, FormatSizeOptions, DECIMAL};
3
4 fn main() {
5 // Create a new FormatSizeOptions struct starting from one of the defaults
6 let custom_options = FormatSizeOptions::from(DECIMAL).decimal_places(5);
7
8 // Then use it
9 println!("{}", format_size(3024usize, custom_options));
10 }