Giter Site home page Giter Site logo

numbers_and_words's Introduction

Convert numbers to words using the I18n library.

Перевод чисел в слова при помощи библиотеки I18n.

Converti les nombres en lettres en utilisant la librairie I18n.

Supported Languages / Языки / Langues Supportées

  • English

  • Русский

  • Français

  • Українська

  • Türkçe**

  • Italiano**

  • Nederlands**

** Experimental

Examples / Примеры / Exemples

I18n.with_locale(:en) { 42.to_words }
=> "forty-two"

I18n.with_locale(:ru) { 42.to_words }
=> "сорок два"

I18n.with_locale(:fr) { 42.to_words }
=> "quarante-deux"

21.to_words
=> "twenty-one"
=> "двадцать один"
=> "vingt et un"
=> "двадцять один"
=> "yirmi bir"
=> "ventiuno"
=> "éénentwintig"

231.to_words
=> "two hundred thirty-one"
=> "двести тридцать один"
=> "deux cent trente-trois"
=> "двiстi тридцять один"
=> "iki yüz otuz bir"
=> "2 cento trentauno"
=> "tweehonderdéénendertig"

4030.to_words
=> "four thousand thirty"
=> "четыре тысячи тридцать"
=> "quatre mille trente"
=> "чотири тисячi тридцять"
=> "dört bin otuz"
=> "quattro mille trenta"
=> "vierthousanddertig"

1000100.to_words
=> "one million one hundred"
=> "один миллион сто"
=> "un million cent"
=> "один мiльйон сто"
=> "bir milyon bir yüz"
=> "uno milione 1 cento"
=> "één miljoen honderd"

1000000000000000000000000000000000.to_words
=> "one decillion"
=> "один дециллион"
=> "un quintilliard"
=> "один децильйон"
=> "bir desilyon"
=> "uno decillion"
=> "één decillion"

[1, 2, 3].to_words
=> ["one", "two", "three"]
=> ["один", "два", "три"]
=> ["un", "deux", "trois"]

[11, 22, 133].to_words
=> ["eleven", "twenty-two", "one hundred thirty-three"] 
=> ["одиннадцать", "двадцать два", "сто тридцать три"]
=> ["onze", "vingt-deux", "cent trente-trois"]
=> ["одинадцять", "двадцять два", "сто тридцять три"]
=> ["on bir", "yirmi iki", "bir yüz otuz üç"]
=> ["undici", "ventidue", "1 cento trentatre"]
=> ["elf", "tweeentwintig", "honderddrieendertig"]

Requirements / Требования / Configuration Requise

  • 1.8.7 <= Ruby (compatible with/совместимость с/compatible avec Ruby 1.9, JRuby and/и/et Rubinius);

  • 0.5.0 <= I18n (earlier versions not tested/ранние версии не тестировались/versions précédentes non testées);

Installation / Установка / Installation

gem install numbers_and_words

License / Лицензия / Licence

MIT License

Bugs and Language Support / Поправки и Новые Языки / Bugs et Support d’autres Langues

See CHANGELOG.md for last changes.

Fork the project. Make your feature addition or bug fix with tests.

Send a pull request. Bonus points for topic branches.

Contacts / Контакты / Contacts

numbers_and_words's People

Contributors

dblock avatar kslazarev avatar sorich87 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.