[#903] config: support floating-point sizes

Rounding is done using the suffix boundary (i.e. floating point value
with `gb` suffix will return size which is an integer number of
megabytes).

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-11-11 14:49:27 +03:00 committed by LeL
parent e7fd980951
commit aba09bb853
4 changed files with 31 additions and 5 deletions

View file

@ -54,6 +54,9 @@
"size_mb": "12m",
"size_gb": "4g",
"size_tb": "5 TB",
"size_float": ".5t",
"size_float_big": "14.123 gb",
"size_i_am_not_very_clever": "12.12345678",
"size_bytes": "2048b",
"size_bytes_no_suffix": 123456
},

View file

@ -47,6 +47,9 @@ sizes:
size_mb: 12m
size_gb: 4g
size_tb: 5 TB
size_float: .5t
size_float_big: 14.123 gb
size_i_am_not_very_clever: 12.12345678
size_bytes: 2048b
size_bytes_no_suffix: 123456