summaryrefslogtreecommitdiffstats
path: root/vendor/humansize/examples/custom_options.rs
blob: dbfd72f875f491e3becd2dbc39637c40c945884f (plain)
1
2
3
4
5
6
7
8
9
10
extern crate humansize;
use humansize::{format_size, FormatSizeOptions, DECIMAL};

fn main() {
    // Create a new FormatSizeOptions struct starting from one of the defaults
    let custom_options = FormatSizeOptions::from(DECIMAL).decimal_places(5);

    // Then use it
    println!("{}", format_size(3024usize, custom_options));
}