Project

jct

0.01
No release in over a year
Japanese excise tax calculator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

> 1.10
> 10.0
 Project Readme

jct

Japanese excise tax calculator

github workflow status crates

Installation

$ gem install jct

Usage

require 'jct'

date = Date.new(2019, 9, 30)
Jct.amount_with_tax(100, date: date) # => 108
Jct.rate(date)                       # => 1.08

# If `date` is not passed, the excise tax rate based on `Date.today` is used
if Date.today == Date.new(2019, 10, 1)
  Jct.amount_with_tax(100)                   # => 110
  Jct.rate                                   # => 1.1

  Jct.amount_with_tax(999)                   # => 1098
  Jct.amount_with_tax(999, fraction: :floor) # => 1098
  Jct.amount_with_tax(999, fraction: :ceil)  # => 1099
end

Contributing

Bug reports and pull requests are welcome!

tips

  • Please separate the PR for additional features from the PR for versioning.

Licenses

JCT is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.