mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Use platform size formatting util
This commit is contained in:
@@ -36,9 +36,6 @@ public class PluginManagerColumnInfo extends ColumnInfo<IdeaPluginDescriptor, St
|
||||
IdeBundle.message("column.plugins.category")
|
||||
};
|
||||
|
||||
private static final float MB = 1024.0f * 1024.0f;
|
||||
private static final float KB = 1024.0f;
|
||||
|
||||
private static final InstalledPluginsState ourState = InstalledPluginsState.getInstance();
|
||||
|
||||
private final int columnIdx;
|
||||
@@ -187,13 +184,7 @@ public class PluginManagerColumnInfo extends ColumnInfo<IdeaPluginDescriptor, St
|
||||
if (size.equals("-1")) {
|
||||
return IdeBundle.message("plugin.info.unknown");
|
||||
}
|
||||
if (size.length() >= 7) {
|
||||
size = String.format("%.1f", (float)Integer.parseInt(size) / MB) + " M";
|
||||
}
|
||||
else if (size.length() >= 4) {
|
||||
size = String.format("%.1f", (float)Integer.parseInt(size) / KB) + " K";
|
||||
}
|
||||
return size;
|
||||
return StringUtil.formatFileSize(Long.parseLong(size));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user