Converts this byte size to a string, use %f for base 1024 or %F for base 1000
Largest ByteSize possible.
Most negative ByteSize possible.
A ByteSize of 0. It's shorter than doing something like size!"bytes"(0) and more explicit than ByteSize.init.
import std.format; assert(1.bytes.toString == "1 B"); assert(1.KiB.toString == "1.00 KiB"); assert(1.MiB.toString == "1.00 MiB"); assert(1.GiB.toString == "1.00 GiB"); assert(1.TiB.toString == "1.00 TiB"); assert(1.PiB.toString == "1.00 PiB"); assert(1.EiB.toString == "1.00 EiB"); assert(1.bytes.format!"%S" == "1 B"); assert(1.KB.format!"%S" == "1.00 KB"); assert(1.MB.format!"%S" == "1.00 MB"); assert(1.GB.format!"%S" == "1.00 GB"); assert(1.TB.format!"%S" == "1.00 TB"); assert(1.PB.format!"%S" == "1.00 PB"); assert(1.EB.format!"%S" == "1.00 EB"); assert("%g".format(1024.bytes) == "1 KiB"); assert("%.2f".format(2_590_000.bytes) == "2.47 MiB");