Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
   4  
   5  use PhpOffice\PhpSpreadsheet\Calculation\Exception;
   6  
   7  class IntClass
   8  {
   9      /**
  10       * INT.
  11       *
  12       * Casts a floating point value to an integer
  13       *
  14       * Excel Function:
  15       *        INT(number)
  16       *
  17       * @param float $number Number to cast to an integer
  18       *
  19       * @return int|string Integer value, or a string containing an error
  20       */
  21      public static function evaluate($number)
  22      {
  23          try {
  24              $number = Helpers::validateNumericNullBool($number);
  25          } catch (Exception $e) {
  26              return $e->getMessage();
  27          }
  28  
  29          return (int) floor($number);
  30      }
  31  }