NexJ Logo

Min()

Finds the smallest value from the specified list of values. This function takes one or more integer, number, or string values as arguments and returns an integer, number, or string value, depending on which value is the smallest. When comparing string values, each character is interpreted as its equivalent numeric ASCII value. For example, the string "A" has the value 65, and "b" has the value 98. The smaller the numeric value of a character is, the smaller it is interpreted to be. So in the previous example, "A" is considered to be smaller than "b".

Syntax

Min(<first_value>, <second_value> ... <last_value>)

Additional arguments must be separated with commas.

Input

first_value

integer, number, string, null

The first value to test.

second_value

integer, number, string, null

(Optional) The second value to test.

last_value

integer, number, string, null

(Optional) The last value to test.

Output

integer, number, string

Examples

  • The expression Min(3, 5, 1) returns 1.
  • The expression Min(3.0, 5.0, 1.0) returns 1.0.
  • The expression Min("a", "B", "c") returns "B".