Settings: Show SD decimals and percent free again

This commit is contained in:
Willy-JL
2024-05-15 03:32:09 +01:00
parent bdeb0351f7
commit ca6e89ec2c
@@ -34,20 +34,24 @@ void storage_settings_scene_sd_info_on_enter(void* context) {
if(sd_info.kb_total < 1024) {
furi_string_cat_printf(app->text_string, "Total: %lu KiB\n", sd_info.kb_total);
} else if(sd_info.kb_total < 1024 * 1024) {
furi_string_cat_printf(app->text_string, "Total: %lu MiB\n", sd_info.kb_total / 1024);
furi_string_cat_printf(
app->text_string, "Total: %.2f MiB\n", (double)sd_info.kb_total / 1024);
} else {
furi_string_cat_printf(
app->text_string, "Total: %lu GiB\n", sd_info.kb_total / (1024 * 1024));
app->text_string, "Total: %.2f GiB\n", (double)sd_info.kb_total / (1024 * 1024));
}
if(sd_info.kb_free < 1024) {
furi_string_cat_printf(app->text_string, "Free: %lu KiB\n", sd_info.kb_free);
furi_string_cat_printf(app->text_string, "Free: %lu KiB", sd_info.kb_free);
} else if(sd_info.kb_free < 1024 * 1024) {
furi_string_cat_printf(app->text_string, "Free: %lu MiB\n", sd_info.kb_free / 1024);
furi_string_cat_printf(
app->text_string, "Free: %.2f MiB", (double)sd_info.kb_free / 1024);
} else {
furi_string_cat_printf(
app->text_string, "Free: %lu GiB\n", sd_info.kb_free / (1024 * 1024));
app->text_string, "Free: %.2f GiB", (double)sd_info.kb_free / (1024 * 1024));
}
furi_string_cat_printf(
app->text_string, " (%.2f%%)\n", (double)sd_info.kb_free * 100 / sd_info.kb_total);
furi_string_cat_printf(
app->text_string,