Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moneyforward/jct
Japanese excise tax calculator
https://github.com/moneyforward/jct
japanese tax
Last synced: about 1 month ago
JSON representation
Japanese excise tax calculator
- Host: GitHub
- URL: https://github.com/moneyforward/jct
- Owner: moneyforward
- License: apache-2.0
- Created: 2022-02-25T03:32:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-28T10:47:06.000Z (over 1 year ago)
- Last Synced: 2024-05-01T15:27:42.775Z (8 months ago)
- Topics: japanese, tax
- Language: Ruby
- Homepage: https://rubygems.org/gems/jct
- Size: 146 KB
- Stars: 16
- Watchers: 117
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
![jct](./resources/jct.png)
Japanese excise tax calculator
[![github workflow status](https://img.shields.io/github/workflow/status/moneyforward/jct/CI/main)](https://github.com/moneyforward/jct/actions) [![crates](https://img.shields.io/gem/v/jct)](https://rubygems.org/gems/jct)
## Installation
```
$ gem install jct
```## Usage
```ruby
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.1Jct.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](./LICENSE) for the full license text.