تابع Is Not a Number / تشخیص عدد نبودن
Original Bizagi title: Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Business Rules examples > Math operations, strings and data validations > Perform Math operations > Is Not a Number
اتوماسیون فرایند Low-code / محیط طراحی Studio Cloud / Bizagi Studio / Wizard فرایند / Ruleهای کسبوکار / قواعد کسبوکار / مثالهای Ruleهای کسبوکار / , داده اعتبارسنجی ها / انجام عملیات Math / ریاضی / تابع Is Not a Number / تشخیص عدد نبودن
This function checks if a parameter is not a number:
•Returns true if the parameter is not a number.
•Returns false if the parameter is a number.
The parameter of this function can be defined as an XPath, variable or number.
Considerations
•The supported attribute types to use as input XPath parameter (or Xpaths stored in variables) are: integer, currency, float, real.
Example
Suppose you want to evaluate if the parameters to be used in a Math function are numbers in order to avoid errors or incoherent results. To do so you can use the IsNaN function:

//Evaluate if of the parameters to be used in the average function are numbers
Number1IsNotaNumber=CHelper.Math.IsNaN(<Product.Price1>);
Number2IsNotaNumber=CHelper.Math.IsNaN(<Product.Price2>);
if (Number1IsNotaNumber==true || Number1IsNotaNumber==true)
{
//If not show an error message
CHelper.ThrowValidationError("The parameters of the Average function must be numbers");
}else{
//If so, apply the math function
CHelper.Math.Average([<Product.Price1>,<Product.Price2>]);
}
Last Updated 1/6/2022 4:19:24 PM