Max

Description

Returns the higher value of two numbers.

Category

Date and time functions

Syntax


Max(number1, number2) 

See also

Min

Parameters

Parameter
Description
number1, number2
Any numbers.

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 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 = "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>    







Banner.Novgorod.Ru