mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Display media sizes in international system units. Fixes #334
This commit is contained in:
@@ -214,8 +214,23 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
blocks++;
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke($"Media has {blocks} blocks of {blockSize} bytes/each. (for a total of {blocks * (ulong)blockSize} bytes)");
|
||||
ulong totalSize = blocks * blockSize;
|
||||
|
||||
if(totalSize > 1099511627776)
|
||||
UpdateStatus?.
|
||||
Invoke($"Media has {blocks} blocks of {blockSize} bytes/each. (for a total of {totalSize / 1099511627776d:F3} TiB)");
|
||||
else if(totalSize > 1073741824)
|
||||
UpdateStatus?.
|
||||
Invoke($"Media has {blocks} blocks of {blockSize} bytes/each. (for a total of {totalSize / 1073741824d:F3} GiB)");
|
||||
else if(totalSize > 1048576)
|
||||
UpdateStatus?.
|
||||
Invoke($"Media has {blocks} blocks of {blockSize} bytes/each. (for a total of {totalSize / 1048576d:F3} MiB)");
|
||||
else if(totalSize > 1024)
|
||||
UpdateStatus?.
|
||||
Invoke($"Media has {blocks} blocks of {blockSize} bytes/each. (for a total of {totalSize / 1024d:F3} KiB)");
|
||||
else
|
||||
UpdateStatus?.
|
||||
Invoke($"Media has {blocks} blocks of {blockSize} bytes/each. (for a total of {totalSize} bytes)");
|
||||
}
|
||||
|
||||
// Check how many blocks to read, if error show and return
|
||||
|
||||
Reference in New Issue
Block a user