public static string ReadableSize(BotData data, [Variable] string input, bool outputBits = false, bool binaryUnit = false, int decimalPlaces = 2) { var size = SizeConverter.ToReadableSize(long.Parse(input), outputBits, binaryUnit, decimalPlaces); data.Logger.LogHeader(); data.Logger.Log($"Converted {input} bytes into the string {size}", LogColors.Flavescent); return(size); }
public void ToReadableSize_GigaBytes_PrintSize() { Assert.Equal("4.12 GB", SizeConverter.ToReadableSize(4123456789, false, false, 2)); }
public void ToReadableSize_GigaBits_PrintSize() { Assert.Equal("32.98 Gbit", SizeConverter.ToReadableSize(4123456789, true, false, 2)); }
public void ToReadableSize_GibiBits_PrintSize() { Assert.Equal("30.722 Gibit", SizeConverter.ToReadableSize(4123456789, true, true, 3)); }
public void ToReadableSize_GibiBytes_PrintSize() { Assert.Equal("3.8 GiB", SizeConverter.ToReadableSize(4123456789, false, true, 1)); }