540
Max
Description
Returns the higher value of two numbers.
Category
Date and time functions
Max(number1, number2)
Syntax
See also
Min
Parameters
Parameter
number1, number2
Example
<!--- This example shows the Max and Min
of two numbers --->
<html>
<head>
<title>
Max Example
</title>
</head>
<body bgcolor = silver>
<H3>Max Example</H3>
<cfif IsDefined("FORM.myNum1")>
</cfif>
<form action = "max.cfm" method = "POST">
<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>
</body>
</html>
<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>
Chapter 3 ColdFusion Functions
Description
Any numbers.
Need help?
Do you have a question about the COLDFUSION 5 - CFML and is the answer not in the manual?