Price Markup
priceMarkup allows the selling price to be calculated from the cost price based on a markup value
The default markup is 0.25 (25%)
The number of figures after the decimal point may be specified. The default is zero if the first argument is an integer but two otherwise.
Installation
Add this line to your application's Gemfile:
gem 'priceMarkup'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install priceMarkup
Usage
Dowstore.priceMarkup( price, markup, decimal_places)
Dowstore.priceMarkup(100) => "125"
Dowstore.priceMarkup(100, 2) => "300"
Dowstore.priceMarkup(100, 2, 3) => "300.000"
Dowstore.priceMarkup(100, 2.5556, 1) => "355.6"
Dowstore.priceMarkup(100.75, 2.5, 4) => "352.6250"
Dowstore.priceMarkup(100.75, 2.5, 0) => "353"
Contributing
Written by Thomas Dowling (tomgdow)
The National College of Ireland