| 1 | use super::{BaseUnit, FormatSizeOptions, Kilo};
|
| 2 |
|
| 3 | /// Options to display sizes in the SI format.
|
| 4 | pub const BINARY: FormatSizeOptions = FormatSizeOptions {
|
| 5 | base_unit: BaseUnit::Byte,
|
| 6 | kilo: Kilo::Binary,
|
| 7 | units: Kilo::Binary,
|
| 8 | decimal_places: 2,
|
| 9 | decimal_zeroes: 0,
|
| 10 | fixed_at: None,
|
| 11 | long_units: false,
|
| 12 | space_after_value: true,
|
| 13 | suffix: "" ,
|
| 14 | };
|
| 15 |
|
| 16 | /// Options to display sizes in the SI (decimal) format.
|
| 17 | pub const DECIMAL: FormatSizeOptions = FormatSizeOptions {
|
| 18 | base_unit: BaseUnit::Byte,
|
| 19 | kilo: Kilo::Decimal,
|
| 20 | units: Kilo::Decimal,
|
| 21 | decimal_places: 2,
|
| 22 | decimal_zeroes: 0,
|
| 23 | fixed_at: None,
|
| 24 | long_units: false,
|
| 25 | space_after_value: true,
|
| 26 | suffix: "" ,
|
| 27 | };
|
| 28 |
|
| 29 | /// Options to display sizes in the "WINDOWS" format.
|
| 30 | /// Uses 1024 as the value of the `Kilo`, but displays decimal-style units (`kB`, not `KiB`).
|
| 31 | pub const WINDOWS: FormatSizeOptions = FormatSizeOptions {
|
| 32 | base_unit: BaseUnit::Byte,
|
| 33 | kilo: Kilo::Binary,
|
| 34 | units: Kilo::Decimal,
|
| 35 | decimal_places: 2,
|
| 36 | decimal_zeroes: 0,
|
| 37 | fixed_at: None,
|
| 38 | long_units: false,
|
| 39 | space_after_value: true,
|
| 40 | suffix: "" ,
|
| 41 | };
|
| 42 | |