mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
[Peek]Add Drive Previewer (#31476)
* Add drives previewer to Peek * minor fixes * fix spellcheck
This commit is contained in:
committed by
GitHub
parent
92c85630a9
commit
7c91dada64
@@ -13,7 +13,7 @@ namespace Peek.Common.Helpers
|
||||
private const int MaxDigitsToDisplay = 3;
|
||||
private const int PowerFactor = 1024;
|
||||
|
||||
public static string BytesToReadableString(ulong bytes)
|
||||
public static string BytesToReadableString(ulong bytes, bool showTotalBytes = true)
|
||||
{
|
||||
string totalBytesDisplays = (bytes == 1) ?
|
||||
ResourceLoaderInstance.ResourceLoader.GetString("ReadableString_ByteString") :
|
||||
@@ -41,7 +41,7 @@ namespace Peek.Common.Helpers
|
||||
|
||||
string formatSpecifier = GetFormatSpecifierString(index, number, bytes, precision);
|
||||
|
||||
return bytes == 0
|
||||
return bytes == 0 || !showTotalBytes
|
||||
? string.Format(CultureInfo.CurrentCulture, formatSpecifier, number)
|
||||
: string.Format(CultureInfo.CurrentCulture, formatSpecifier + totalBytesDisplays, number, bytes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user