Skip to content

kulbida/as_currency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

As Currency

This gem provides extra methods for the AR model to display number as a currency.

Usage

Lets assume you have a Fee model with amount property. Add next line to the Fee model.

as_currency :total

After that you have a brand new method total_as_currency that going to return a currency friendly value from the total property.

@fee.total_as_currency

By the way, you can add as many fields to the as_currency as you want, for instance:

as_currency :total, :budget, :salary

You will get 3 more methods to display particular value as a currency.

Copyright © 2012 Bogdan Kulbida. See LICENSE.txt for further details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages