Project

percentise

0.0
No commit activity in last 3 years
No release in over 3 years
Simple, consistent Percentises
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

 Project Readme
Percentise
==========

A single way to produce consistent percentages

Example
=======

The obvious:
  >> Percentise(50, 100)
  => 50.0
  
Error cases:
  >> Percentise(nil, 100)
  => nil
  >> Percentise(50, nil)
  => nil
  >> Percentise(nil, nil)
  => nil
  
Don't worry about dividing by 0

  >> Percentise(0,0)
  => 0.0
  >> Percentise(1,0)
  => 100.0
  >> Percentise(-1,0)
  => -100.0
  
Find the % difference 

  >> Percentise.diff(50, 100)
  => -50.0
  >> Percentise.diff(100, 50)
  => 100.0
  
Copyright (c) 2010 [Matthew Rudy Jacobs], released under the MIT license