vat_jp

GitHub Workflow Status GitHub GitHub commit activity GitHub last commit

vat_jp calculates consumption tax (incl. sales tax, VAT, excise duty, etc.) in Japan.

Usage

With vat_jp, you can know the price including VAT and the VAT rate at any point in time.

```rs use chrono::{Local, NaiveDate}; use vat_jp;

// To find out the current price including tax, // pass the amount as the first argument and None as the second argument. asserteq!(110, vatjp::amountwithtax::(100, None)); asserteq!( 110, vatjp::amountwithtax::>(100, Some(Local::now())) ); // When there was no VAT... let mut today = NaiveDate::fromymdopt(1989, 3, 31).unwrap(); asserteq!(100, vatjp::amountwithtax::(100, Some(today)));

// VAT rate asserteq!(1.1, vatjp::get_rate::>(Local::now())); ```