CFLib.org – Common Function Library Project

Percentage(value, maximum)

Last updated September 6, 2001

author

Jennifer Larkin

Version: 1 | Requires: CF5 | Library: MathLib

Description:
Divides value by maximum, multiplies the result by 100, and returns the percenage. Returns repeating decimals to ten decimal places.

Return Values:
Returns the percentage.

Example:

<cfoutput>
Your score is #Round(percentage(1,3))# %.
</cfoutput>

Parameters:

Name Description Required
value The value. Yes
maximum The maximum value. Yes

Full UDF Source:

/**
 * Returns the percentage of value out of maximum.
 * 
 * @param value 	 The value. 
 * @param maximum 	 The maximum value. 
 * @return Returns the percentage. 
 * @author Jennifer Larkin (mr_urc@drule.org) 
 * @version 1, September 6, 2001 
 */
function percentage(Value,Maximum) {
  return ((Value/Maximum)*100);
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson