Project

valuta

0.0
No commit activity in last 3 years
No release in over 3 years
Formats a number into a currency string (e.g., $1,567.65).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 1.2
 Project Readme

valuta

Formats a number with grouped thousands. You can customize the format in the options hash.

Usage

require "valuta"

Valuta.convert(1458)                  # => 1,458
Valuta.convert(1458.65)               # => 1,458.65
Valuta.convert("1458.65")             # => 1,458.65
Valuta.convert(1458, prefix: "$")     # => $1,458
Valuta.convert(1458, suffix: " NOK")  # => 1,458 NOK
Valuta.convert(1458, suffix: " ft²")  # => 1,458 ft²

Valuta.convert(100458.65, delimiter: ".", separator: ",")
# => 100.458,65

Contributing

  • Fork the project.
  • Use make install to install dependencies.
  • Use make test to run the test suite.
  • Create a pull request with your changes.

Installation

$ gem install valuta