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);
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson