Is Positive

Categories

Component ID

2693279

Component name

Is Positive

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Check if something is a positive number. This module doesn't consider 0 to be a positive number and doesn't distinguish between -0 and 0. If you want to detect 0, use the positive_zero module.

The module allows other modules to alter its behaviour. Here's an example of how to modify it to include 0.

<?php
function MY_MODULE_is_positive_alter($value, &$result) {
  $result = $value >= 0;
}
?>