mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
25 lines
714 B
C#
25 lines
714 B
C#
using System;
|
|
|
|
namespace Dalamud.Interface.ImGuiFileDialog;
|
|
|
|
/// <summary>
|
|
/// A file or folder picker.
|
|
/// </summary>
|
|
public partial class FileDialog
|
|
{
|
|
private static string FormatModifiedDate(DateTime date)
|
|
{
|
|
return date.ToString("yyyy/MM/dd HH:mm");
|
|
}
|
|
|
|
private static string BytesToString(long byteCount)
|
|
{
|
|
string[] suf = { " B", " KB", " MB", " GB", " TB" };
|
|
if (byteCount == 0)
|
|
return "0" + suf[0];
|
|
var bytes = Math.Abs(byteCount);
|
|
var place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));
|
|
var num = Math.Round(bytes / Math.Pow(1024, place), 1);
|
|
return (Math.Sign(byteCount) * num).ToString() + suf[place];
|
|
}
|
|
}
|