Closed danielepantaleone closed 6 years ago
Acually now that I think about this PR, I could have handled some more cases, so hold on 😉
Alright, it's good to go for me. I introduced a new function to format sizes: Q_SizeFormat. The output granularity is regulated according with the given input and the format factor: for T(era), G(iga) and M(ega) I used 2 decimal floating point precision, while for K(ilo) and default I used integer precision. Example output:
QSizeFormat(1548576, 1024) -> "1.47 M"
QSizeFormat(1048, 1024) -> "1 K"
QSizeFormat(100, 1024) -> "100 "
Added another commit to sort out issue #16
This pull request fixes #16 and #17