@@ -16,7 +16,7 @@ std::optional<int> try_convert_to_int(const std::string& str) {
16
16
}
17
17
}
18
18
19
- static std::string get_pretty_str_from_float ( float value) {
19
+ static std::string get_pretty_str_from_double ( double value) {
20
20
std::ostringstream ss;
21
21
ss << std::fixed << std::setprecision (2 ) << value; // Set precision to 2 digit after the decimal point
22
22
return ss.str ();
@@ -25,7 +25,7 @@ static std::string get_pretty_str_from_float(float value) {
25
25
std::string get_pretty_duration_str_from_ms (int64_t duration_ms) {
26
26
std::string result;
27
27
if (duration_ms >= 1000 ) {
28
- result = get_pretty_str_from_float (duration_ms / 1000 .0f ) + " sec" ;
28
+ result = get_pretty_str_from_double (duration_ms / 1000.0 ) + " sec" ;
29
29
} else {
30
30
result = std::to_string (duration_ms);
31
31
result += " ms" ;
@@ -36,11 +36,11 @@ std::string get_pretty_duration_str_from_ms(int64_t duration_ms) {
36
36
std::string get_pretty_size_str_from_bytes_num (int64_t bytes_num) {
37
37
std::string result;
38
38
if (bytes_num >= 1024 *1024 *1024 ) {
39
- result = get_pretty_str_from_float (bytes_num / float (1024 *1024 *1024 )) + " Gb" ;
39
+ result = get_pretty_str_from_double (bytes_num / double (1024 *1024 *1024 )) + " Gb" ;
40
40
} else if (bytes_num >= 1024 *1024 ) {
41
- result = get_pretty_str_from_float (bytes_num / float (1024 *1024 )) + " Mb" ;
41
+ result = get_pretty_str_from_double (bytes_num / double (1024 *1024 )) + " Mb" ;
42
42
} else if (bytes_num >= 1024 ) {
43
- result = get_pretty_str_from_float (bytes_num / float (1024 )) + " Kb" ;
43
+ result = get_pretty_str_from_double (bytes_num / double (1024 )) + " Kb" ;
44
44
} else {
45
45
result = std::to_string (bytes_num) + " bytes" ;
46
46
}
0 commit comments