mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-25 21:37:33 +00:00
Fix a rounding error in human readable filesizes
This commit is contained in:
parent
13b91cced4
commit
74ecf6d311
@ -41,8 +41,8 @@ impl f::Size {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let symbol = prefix.symbol();
|
let symbol = prefix.symbol();
|
||||||
let number = if n < 10_f64 { numerics.format_float(n, 1) }
|
let decimal_to_diplay = if n < 10_f64 { 1 } else { 0 };
|
||||||
else { numerics.format_int(n as isize) };
|
let number = numerics.format_float(n, decimal_to_diplay);
|
||||||
|
|
||||||
// The numbers and symbols are guaranteed to be written in ASCII, so
|
// The numbers and symbols are guaranteed to be written in ASCII, so
|
||||||
// we can skip the display width calculation.
|
// we can skip the display width calculation.
|
||||||
|
Loading…
Reference in New Issue
Block a user