0.0
No release in over 3 years
Low commit activity in last 3 years
Gem for converting numbers to german words and vise-versa.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

GermanNumbers

German numbers is a ruby gem for converting numbers into German strings and vise-versa. It supports numbers up to 999 999 999 999. Also it can handle malformed and invalid strings. See examples below.

Installation

gem install german_numbers

or

gem 'german_numbers' in your Gemfile.

Usage

require 'german_numbers'

GermanNumbers.stringify(213_431_983_111) # => "zweihundertdreizehn Milliarden vierhunderteinunddreißig Millionen neunhundertdreiundachtzigtausendeinhundertelf"

GermanNumbers.parse("zweihundertdreizehn Milliarden vierhunderteinunddreißig Millionen neunhundertdreiundachtzigtausendeinhundertelf") # => 213_431_983_111
GermanNumbers.parse("invalid") # => GermanNumbers::Parser::ParsingError: invalid is not a valid German number

GermanNumbers.valid?("zweihundertdreizehn Milliarden vierhunderteinunddreißig Millionen neunhundertdreiundachtzigtausendeinhundertelf") # => true
GermanNumbers.valid?("invalid") # => false

Contributing

You know=)