Human Bytes Beta
A package for V that converts bytes into human-friendly strings.
Repository: https://github.com/mikerockett/human_bytes
Readme
Usage:
import human_bytes { convert, convert_opt } // Normal conversionsconvert(10) // 10 Bconvert(1001) // 1 kB // Conversions with optionsconvert_opt(1001, signed: true) // +1 kBconvert_opt(1001, bits: true) // 1 kbitconvert_opt(1e16, binary: true) // 8.88 PiBconvert_opt(1025, bits: true, binary: true, signed: true) // +1 kibit
Published 18 July 2021 in vlang