decimalToStandardTime() public static method

Hours, minutes e.g. 9.5 => 9.3 with pad=2: 9.30
public static decimalToStandardTime ( integer $value, string | null $pad = null, string $decPoint = '.' ) : string
$value integer
$pad string | null
$decPoint string
return string
Ejemplo n.º 1
0
 /**
  * 9.50 => 9.30
  *
  * @return void
  */
 public function testDecimalStandard()
 {
     //echo $this->_header(__FUNCTION__);
     $value = '9.50';
     $is = $this->Time->decimalToStandardTime($value);
     $this->assertEquals('9.3', round($is, 2));
     $value = '9.5';
     $is = $this->Time->decimalToStandardTime($value);
     //pr($is);
     $this->assertEquals('9.3', $is);
     $is = $this->Time->decimalToStandardTime($value, 2);
     //pr($is);
     $this->assertEquals('9.30', $is);
     $is = $this->Time->decimalToStandardTime($value, 2, ':');
     //pr($is);
     $this->assertEquals('9:30', $is);
 }