public static string ToKibibyte()

in Core/src/Impl/PresentationUtil.cs [31:46]


    public static string ToKibibyte(this ulong value)
    {
      if (value < 1000U)
        return $"{value} B";
      if (value < 1000U * 1000)
        return $"{value / 1024d:F2} KiB";
      if (value < 1000U * 1000 * 1000)
        return $"{value / (1024d * 1024):F2} MiB";
      if (value < 1000UL * 1000 * 1000 * 1000)
        return $"{value / (1024d * 1024 * 1024):F2} GiB";
      if (value < 1000UL * 1000 * 1000 * 1000 * 1000)
        return $"{value / (1024d * 1024 * 1024 * 1024):F2} TiB";
      if (value < 1000UL * 1000 * 1000 * 1000 * 1000 * 1000)
        return $"{value / (1024d * 1024 * 1024 * 1024 * 1024):F2} PiB";
      return $"{value} B";
    }