#percentage #percent #integer #floats #divide #add #percentages

bin+lib percent-rs

Simple crate for percentages of integers and floats

2 releases

0.1.1 Jul 23, 2024
0.1.0 Jul 4, 2024

#4 in #percentage

Download history 106/week @ 2024-07-23 8/week @ 2024-07-30 18/week @ 2024-09-10 6/week @ 2024-09-17 5/week @ 2024-09-24 6/week @ 2024-10-01

57 downloads per month

MIT license

8KB
138 lines

Percent-RS

Simple implementation of a percentage that you can add, subtract, multiply, and divide.

Usage

use percent_rs::Percentage;

fn main() {
    let percent = Percentage::from(50);
    let percent_decimal = Percentage::from_decimal(50.5);
    println!("{}", percent); // 50%
    println!("{}", percent_decimal); // 55.5%
}

Dependencies

~185KB