Currently FromHumanSize can only interpret format of '32kB', this commit
enhance it to interpret float64 string with blank such as '32.3 kB'.
Signed-off-by: Zhang Wei zhangwei555@huawei.com
I need this function for doing docker stats integration test, because docker stats use HumanSize to format byte into human readable string, now I need to revert the string to byte number. But FromHumanSize can't interpret 23.3 kB, so this commit add float64 support.
I also add the blank support but it doesn't matter if you don't like it.
I think you may have special considerations for only supporting int64, but I'm not sure what's it.
I can make relevant change based on your ideas.
Ping @calavera
Currently FromHumanSize can only interpret format of '32kB', this commit enhance it to interpret float64 string with blank such as '32.3 kB'.
Signed-off-by: Zhang Wei zhangwei555@huawei.com
I need this function for doing
docker stats
integration test, becausedocker stats
useHumanSize
to format byte into human readable string, now I need to revert the string to byte number. ButFromHumanSize
can't interpret23.3 kB
, so this commit add float64 support.I also add the blank support but it doesn't matter if you don't like it.
I think you may have special considerations for only supporting int64, but I'm not sure what's it. I can make relevant change based on your ideas. Ping @calavera