DecimalDataSize

Provides decimal (base-1000) data size constants, following SI standards (e.g., KB, MB). This is typically used for file systems, network speeds, and other contexts where base-1000 units are standard.

The constants are defined using powers of 1000 for accurate decimal scaling. Extension properties (e.g., kb, mb) are provided for convenient conversion of Int, Long, and Double values to their respective decimal data sizes.

For petabyte (pb) and exabyte (eb) conversions, use the Safe variants (e.g., pbSafe, ebSafe) to avoid overflow risks with large numbers.

See also

for binary (base-1024) units

for the interface defining these constants

Properties

Link copied to clipboard
open override val exabyte: Long

Number of bytes in an exabyte (EB or EiB, depending on the implementation).

Link copied to clipboard
open override val gigabyte: Long

Number of bytes in a gigabyte (GB or GiB, depending on the implementation).

Link copied to clipboard
open override val kilobyte: Long = 1000

Number of bytes in a kilobyte (KB or KiB, depending on the implementation).

Link copied to clipboard
open override val megabyte: Long

Number of bytes in a megabyte (MB or MiB, depending on the implementation).

Link copied to clipboard
open override val petabyte: Long

Number of bytes in a petabyte (PB or PiB, depending on the implementation).

Link copied to clipboard
open override val terabyte: Long

Number of bytes in a terabyte (TB or TiB, depending on the implementation).