numbers_and_words <img src=“https://secure.travis-ci.org/kslazarev/numbers_and_words.png” />¶ ↑
Convert numbers to words using the I18n library.
Перевод чисел в слова при помощи библиотеки I18n.
-
English
-
Русский
I18n.with_locale(:en) { 42.to_words } => "forty-two" I18n.with_locale(:ru) { 42.to_words } => "сорок два" 21.to_words => "twenty-one" => "двадцать один" 231.to_words => "two hundred thirty-one" => "двести тридцать один" 4030.to_words => "four thousand thirty" => "четыре тысячи тридцать" 1000100.to_words => "one million one hundred" => "один миллион сто" 1000000000000000000000000000000000.to_words => "one decillion" => "один дециллион" [1, 2, 3].to_words => ["one", "two", "three"] => ["один", "два", "три"] [11, 22, 133].to_words => ["eleven", "twenty-two", "one hundred thirty-three"] => ["одиннадцать", "двадцать два", "сто тридцать три"]
-
1.8.7 <= Ruby (compatible with/совместимость с Ruby 1.9, JRuby and/и Rubinius);
-
0.5.0 <= I18n (earlier versions not tested/ранние версии не тестировались);
gem install numbers_and_words
MIT License
Fork the project. Make your feature addition or bug fix with tests. Send a pull request. Bonus points for topic branches.
-
Kirill Lazarev ([email protected])
-
Daniel Doubrovkine (http://github.com/dblock)