Sha256: 7a2cf1f2f2e1850e0fb37bd3d93d693cbed86c50dfb8e1f694c641e5e61f3ab9
Contents?: true
Size: 1.44 KB
Versions: 1
Compression:
Stored size: 1.44 KB
Contents
# Papla [![Build Status](https://secure.travis-ci.org/exviva/papla.png)](http://travis-ci.org/exviva/papla) Papla is a Ruby gem that allows you to convert numbers into Polish words (e.g. `153` into `"sto pięćdziesiąt trzy"`), including the decimal part as cents and currency symbol. Its primary use case are invoices, where the total amount has to be displayed as words at the bottom line. ## Installation To install Papla, run gem install papla or add ```ruby gem 'papla' ``` to your `Gemfile`. ## Usage ### Basic examples ```ruby Papla[158] # => "Sto pięćdziesiąt osiem" Papla[1_234] # => "Tysiąc dwieście trzydzieści cztery" Papla[987_654_321] # => "Dziewięćset osiemdziesiąt siedem milionów sześćset pięćdziesiąt cztery tysiące trzysta dwadzieścia jeden" ``` ### Cents and currency #### Cents When given a `Float`, Papla will assume that the decimal part represents cents. It will then round the number using `Float#round` to two decimal places, and append the number of cents divided by hundred to the resulting string. Example: ```ruby Papla[1.0] # => "Jeden 00/100" Papla[87.654321] # => "Osiemdziesiąt siedem 65/100" Papla[2.999] # => "Trzy 00/100" ``` #### Currency This feature is planned for future releases. ### Integration with Money, I18n and Rails This feature is planned for future releases. ## Documentation Documentation is available at [RubyDoc.info](http://rubydoc.info/github/exviva/papla/master/frames).
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
papla-0.0.2 | README.md |