Add improved FormatBytesCount to print large sizes in more detailed way

Instead of printing `2 GB` output `2.43 GB` to be more explicit.
Deprecate version with `int` in favor of a single `ulong`.
This commit is contained in:
Wojtek Figat
2024-08-17 14:35:13 +02:00
parent 7650cead3d
commit 650a2921a3
7 changed files with 14 additions and 16 deletions

View File

@@ -388,7 +388,7 @@ namespace FlaxEditor.Content
{
sb.Append("Type: ").Append(TypeDescription).AppendLine();
if (File.Exists(Path))
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine();
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((ulong)new FileInfo(Path).Length)).AppendLine();
sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine();
}