You are here

function Utils::wf_crm_is_positive in Webform CiviCRM Integration 8.5

Check if value is a positive integer

Parameters

mixed $val:

Return value

bool

Overrides UtilsInterface::wf_crm_is_positive

File

src/Utils.php, line 872
Webform CiviCRM module's common utility functions.

Class

Utils

Namespace

Drupal\webform_civicrm

Code

function wf_crm_is_positive($val) {
  return is_numeric($val) && $val > 0 && round($val) == $val;
}