4 releases

0.2.0 Dec 2, 2024
0.1.2 Dec 2, 2024
0.1.1 Dec 2, 2024
0.1.0 Dec 2, 2024

#75 in Finance

Download history 240/week @ 2024-11-27 112/week @ 2024-12-04 12/week @ 2024-12-11

203 downloads per month

EUPL-1.2

13KB
192 lines

Income Tax Calculation

Crates.io Crates.io GitHub Workflow Status Safety Dance docs.rs codecov

This Rust crate provides functionality for income tax calculation in different years. It is currently aimed at German income tax but is welcome to additions for different countries and years.

use income_tax::{IncomeTax, germany};

fn germany_2024() {
    let tax = germany::IncomeTax2024;

    let net_income = tax.calculate(70_000.0);
    assert_eq!(net_income, Ok(18_797.0));
    
    let refund = tax.tax_refund(100_000.0, 50_000.0);
    assert_eq!(refund, Ok(20_491.0));
}

Dependencies

~160KB