Skip to content

maynkj/valuta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Formats a number into grouped thousands (e.g., 1,567.65)

Resources

License

Stars

Watchers

Forks

Packages

No packages published