https://github.com/0x2c6/azn-converter
Convert any number to current or spesific currency
https://github.com/0x2c6/azn-converter
azn azn-converter gem manat ruby
Last synced: 12 months ago
JSON representation
Convert any number to current or spesific currency
- Host: GitHub
- URL: https://github.com/0x2c6/azn-converter
- Owner: 0x2C6
- License: mit
- Created: 2018-08-19T14:29:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T15:52:42.000Z (almost 8 years ago)
- Last Synced: 2025-07-12T07:01:50.730Z (12 months ago)
- Topics: azn, azn-converter, gem, manat, ruby
- Language: Ruby
- Homepage: https://rubygems.org/gems/azn_converter
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AZNConverter [](https://badge.fury.io/rb/azn_converter) [](https://travis-ci.org/0x2C6/azn-converter)
Easy to use AZN converter.
You can convert any currency to AZN and its word form.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'azn_converter'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install azn_converter
## Usage
At below you see basic usage. By default it converts from USD
```ruby
require 'azn_converter'
5.to_azn #=> 8.5 with current currency
```
You can specify currency yourself if you doesn't have internet connection
```ruby
5.to_azn(current: 0.78) #=> 3.900...
```
By default we use to convert USD. It can be change by `:from` parameter
```ruby
5.to_azn(from: :eur) #=> 9.68
```
Use `:sign` to add manat symbol to end of the returned value
```ruby
5.to_azn(sign: true) #=> "8.5 ₼"
```
You can get word for of the conversion with `:words` option
```ruby
5.to_azn(words: true) #=> "səkkiz manat əlli qəpik"
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/0x2C6/azn-converter.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).