| 1 | #pragma once |
| 2 | |
| 3 | #include <string> |
| 4 | |
| 5 | namespace DB |
| 6 | { |
| 7 | |
| 8 | class WriteBuffer; |
| 9 | |
| 10 | } |
| 11 | |
| 12 | /// Displays the passed size in bytes as 123.45 GiB. |
| 13 | void formatReadableSizeWithBinarySuffix(double value, DB::WriteBuffer & out, int precision = 2); |
| 14 | std::string formatReadableSizeWithBinarySuffix(double value, int precision = 2); |
| 15 | |
| 16 | /// Displays the passed size in bytes as 132.55 GB. |
| 17 | void formatReadableSizeWithDecimalSuffix(double value, DB::WriteBuffer & out, int precision = 2); |
| 18 | std::string formatReadableSizeWithDecimalSuffix(double value, int precision = 2); |
| 19 | |
| 20 | /// Prints the number as 123.45 billion. |
| 21 | void formatReadableQuantity(double value, DB::WriteBuffer & out, int precision = 2); |
| 22 | std::string formatReadableQuantity(double value, int precision = 2); |
| 23 | |