Example #1
0
 /**
  * Returns value if it is a valid float value, FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  */
 public function testFloat($key)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Zend_Filter::isFloat($this->_source[$key])) {
         return $this->_source[$key];
     }
     return FALSE;
 }
Example #2
0
 /**
  * Returns value if it is a valid float value, FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  */
 public function testFloat($key)
 {
     if (Zend_Filter::isFloat($this->_source[$key])) {
         return $this->_source[$key];
     }
     return FALSE;
 }
Example #3
0
 /**
  * Returns value if it is a valid float value, FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  */
 public function isFloat($key)
 {
     return Zend_Filter::isFloat($this->_source[$key]);
 }
Example #4
0
 /**
  * @deprecated since 0.8.0
  * @return     void
  */
 public function testisFloat()
 {
     $this->assertTrue(Zend_Filter::isFloat(1200.0), '"1.2e3" is a valid float number');
     $this->assertFalse(Zend_Filter::isFloat('ABC'), '"ABC" is not a valid float number');
 }
Example #5
0
 /**
  * Returns value if it is a valid float value, FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  */
 public function testFloat($key = null)
 {
     if (!($value = $this->keyExists($key))) {
         return false;
     }
     if (Zend_Filter::isFloat($value)) {
         return $value;
     }
     return FALSE;
 }