mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: avoid printing -0.00
Nice trick to not print -0.00 for some percent values.
This commit is contained in:
parent
32d6ca9196
commit
0a389691dc
@ -2309,7 +2309,8 @@ static const char *_get_reserved(struct dm_report *rh, unsigned type,
|
||||
|
||||
float dm_percent_to_float(dm_percent_t percent)
|
||||
{
|
||||
return (float) percent / DM_PERCENT_1;
|
||||
/* Add 0.f to prevent returning -0.00 */
|
||||
return (float) percent / DM_PERCENT_1 + 0.f;
|
||||
}
|
||||
|
||||
dm_percent_t dm_make_percent(uint64_t numerator, uint64_t denominator)
|
||||
|
Loading…
Reference in New Issue
Block a user