Adobe ColdFusion 8

Min

Description

Determines the lesser of two numbers.

Returns

The lesser of two numbers.

Category

Mathematical functions

Function syntax

Min(number1, number2)

See also

Maxfilename

Parameters

Parameter

Description

number1, number2

Numbers

Example

<h3>Min Example</h3>
<cfif IsDefined("FORM.myNum1")>
    <cfif IsNumeric(FORM.myNum1) and IsNumeric(FORM.myNum2)>
    <p>The maximum of the two numbers is <cfoutput>#Max(FORM.myNum1, 
     FORM.myNum2)#</cfoutput>    
    <p>The minimum of the two numbers is <cfoutput>#Min(FORM.myNum1, 
     FORM.myNum2)#</cfoutput>    
    <cfelse>
    <p>Please enter two numbers
    </cfif>
</cfif>

<form action = "min.cfm">
<h3>Enter two numbers, and see the maximum and minimum of the two numbers</h3>

Number 1 <input type = "Text" name = "MyNum1">
<br>Number 2 <input type = "Text" name = "MyNum2">

<br><input type = "Submit" name = "" value = "See results">
</form>