| 270 | } |
| 271 | |
| 272 | char * |
| 273 | ghb_format_pretty_size (int64_t bytes) |
| 274 | { |
| 275 | double kilobytes = bytes / 1000; |
| 276 | double megabytes = kilobytes / 1000; |
| 277 | double gigabytes = megabytes / 1000; |
| 278 | if (gigabytes != 0) |
| 279 | { |
| 280 | return g_strdup_printf("%0.1f %s", gigabytes, _("GB")); |
| 281 | } |
| 282 | else if (megabytes != 0) |
| 283 | { |
| 284 | return g_strdup_printf(_("%0.1f %s"), megabytes, _("MB")); |
| 285 | } |
| 286 | else |
| 287 | { |
| 288 | return g_strdup_printf(_("%0.1f %s"), kilobytes, _("KB")); |
| 289 | } |
| 290 | } |
no outgoing calls
no test coverage detected