How To

Using Numeric Functions in Business Rules

Numeric Functions allow Business Rules to operate on numbers. View the table below for Numeric Functions supported for Business Rules.

 

Prerequisites


You should be familiar with the following topics:

 

Numeric Functions Supported for Business Rules


View the table below for Numeric Functions supported for Business Rules.


Function Description Example Output
CEILING Returns the largest whole number greater than or equal to the input number.CEILING(1.23)2
FORMATCURRENCY

Formats numeric text value to a currency type. The simple version just adds two decimal places and formats everything using United States formatting rules; the more complex version allows for other locale formats and allows the currency symbol to be exported. The simple version works as long as the decimal point is okay for the decimal symbol. Use the complex version if any of the following are true:

  • Another culture's format should be used (pass in the 4-character culture name as the second parameter).
  • The currency symbol needs to be output (pass in True for the third parameter)
  • Digit group (thousands) separators are needed (pass in True for the fourth parameter)
FORMATCURRENCY(“5”) FORMATCURRENCY(5000”,”en-GB”,TRUE,TRUE)5.00 5,000.00
FORMATCURRENCY($ITEMRETAILPRICE * 1.75)Increase the Retail Price by 75%.
FORMATCURRENCY($ITEMBINPRICE, "F2")Format a Price field, in this instance the Buy It Now Price, to 2 decimal
places.
FORMATNUMBER Formats a number according to a format specification. Use "Fx" to format to x digits after the decimal.FORMATNUMBER(2.0/3.0, "F5")0.66667
FORMATNUMBER((GETCURRENCYEXCHANGE("USD","EUR") * $Price) + 9.99, "F2")Convert Price from Dollars to Euros, add 9.99 and round to 2 decimal places.
FLOOR Returns the largest whole number less than or equal to the input number.FLOOR(6.54)6
MAX Takes 2 to 8 numeric inputs, returns the largest. You can apply it to an attribute or a string as long as there is only a numeric value in the attribute or a string. If there is a non-numeric value present, it won't work.MAX($ITEMBINPRICE, $ITEMSELLERCOST, "49.99")Send the highest of the Buy It Now Price and Seller Cost or 49.99.

Numeric Functions allow Business Rules to operate on numbers. View the table below for Numeric Functions supported for Business Rules.

 

Prerequisites


You should be familiar with the following topics:

 

Numeric Functions Supported for Business Rules


View the table below for Numeric Functions supported for Business Rules.


Function Description Example Output
CEILING Returns the largest whole number greater than or equal to the input number.CEILING(1.23)2
FORMATCURRENCY

Formats numeric text value to a currency type. The simple version just adds two decimal places and formats everything using United States formatting rules; the more complex version allows for other locale formats and allows the currency symbol to be exported. The simple version works as long as the decimal point is okay for the decimal symbol. Use the complex version if any of the following are true:

  • Another culture's format should be used (pass in the 4-character culture name as the second parameter).
  • The currency symbol needs to be output (pass in True for the third parameter)
  • Digit group (thousands) separators are needed (pass in True for the fourth parameter)
FORMATCURRENCY(“5”) FORMATCURRENCY(5000”,”en-GB”,TRUE,TRUE)5.00 5,000.00
FORMATCURRENCY($ITEMRETAILPRICE * 1.75)Increase the Retail Price by 75%.
FORMATCURRENCY($ITEMBINPRICE, "F2")Format a Price field, in this instance the Buy It Now Price, to 2 decimal
places.
FORMATNUMBER Formats a number according to a format specification. Use "Fx" to format to x digits after the decimal.FORMATNUMBER(2.0/3.0, "F5")0.66667
FORMATNUMBER((GETCURRENCYEXCHANGE("USD","EUR") * $Price) + 9.99, "F2")Convert Price from Dollars to Euros, add 9.99 and round to 2 decimal places.
FLOOR Returns the largest whole number less than or equal to the input number.FLOOR(6.54)6
MAX Takes 2 to 8 numeric inputs, returns the largest. You can apply it to an attribute or a string as long as there is only a numeric value in the attribute or a string. If there is a non-numeric value present, it won't work.MAX($ITEMBINPRICE, $ITEMSELLERCOST, "49.99")Send the highest of the Buy It Now Price and Seller Cost or 49.99.
0
Your rating: None Average: 1 (1 vote)
0
Your rating: None Average: 1 (1 vote)