A thin encapsulate for integer primitives to facilitate a fast, simple, yet ergonomic byteunit implementation.
Go to file
Xavier 7d182d860b Fix to a minor fumble over SI prefixes, some internal refactoring, and minor API additions.
- Added new function max() to byteunit type.
- New public constant 'simplebyteunit::MAX' defining the maximum supported power.
- Output module to house arithmetic and prefix functions for output values.
- For the sake of SI compliance, kilobytes are now prefixed as 'kB'.
2023-09-28 23:08:41 -04:00
.github/workflows Create rust.yml 2023-09-27 05:49:22 +00:00
src Fix to a minor fumble over SI prefixes, some internal refactoring, and minor API additions. 2023-09-28 23:08:41 -04:00
Cargo.lock Initial Commit 2023-09-27 01:12:35 -04:00
Cargo.toml Bump to version 0.1.1 to update crates.io metadata. 2023-09-27 01:43:54 -04:00
LICENSE LICENSE file 2023-09-27 01:17:05 -04:00
README.md Spacing 2023-09-27 01:23:37 -04:00

SimpleByteUnit

SimpleByteUnit is a crate which provides a thin encapsulate for integer primitives to facilitate a fast, simple, yet ergonomic byteunit implementation.

Usage

Add 'simplebyteunit' to your 'Cargo.toml':

[dependencies]
simplebyteunit = "0.1.0"

Example

Generate a human-readable, formatted ByteUnit:

use simplebyteunit::simplebyteunit::*;

let byteunit_var = 500000.to_byteunit(SI);

println!("{byteunit_var}");

Output:

500 KB