Project

lariconv

0.0
No release in over a year
This gem converts different currencies to Georgian Lari based on the National Bank of Georgia's exchange rate for a given date. Compatible with the `money` gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.12
 Project Readme

lariconv

Gem Version

Gem to convert different currencies to Georgian Lari based on the National Bank of Georgia's exchange rate for a given date.

Usage

Lariconv.convert(amount: 1000, currency: 'GBP', date: '2022-08-15')
# => 0.32829e4 (BigDecimal)

Lariconv.convert(amount: BigDecimal('100.68'), currency: 'EUR')
# => 0.28869e3 (BigDecimal)

Lariconv.convert(amount: 1.5, currency: 'USD', date: '2023-08-15').to_f
# => 3.93 (Float)

Lariconv.convert(amount: 100, currency: 'EUR').to_s('F')
# => "288.16" (String)

Lariconv.convert(amount: 'abc', currency: 'EUR')
# => Lariconv::InvalidAmountException

Lariconv.convert(amount: 1000, currency: 'WTF')
# => Lariconv::UnavailableCurrencyException

Copyright

Copyright (c) 2023 Den Patin. See LICENSE for details.