CFLib.org – Common Function Library Project

ZeroMinimum(x)

Last updated January 10, 2002

author

Alan McCollough

Version: 1 | Requires: CF5 | Library: MathLib

Description:
Returns zero if the value passed into NotLessThanZero() is less than zero. If the input value is greater than zero, the iput value is returned.

Return Values:
Returns a numeric value.

Example:

<CFOUTPUT>
ZeroMinimum(9): #ZeroMinimum(9)#<BR>
ZeroMinimum(0): #ZeroMinimum(0)#<BR>
ZeroMinimum(-7): #ZeroMinimum(-7)#
</CFOUTPUT>

Parameters:

Name Description Required
x Value you want to ensure is greater than or equal to zero. Yes

Full UDF Source:

/**
 * Returns zero if the value passed into ZeroMinimum() is less than zero.
 * 
 * @param x 	 Value you want to ensure is greater than or equal to zero. 
 * @return Returns a numeric value. 
 * @author Alan McCollough (amccollough@anmc.org) 
 * @version 1, January 10, 2002 
 */
function ZeroMinimum(x){      
  return max(x,0);
}
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