/** * 2015-12-16 * @return float */ public function valueF() { if (!isset($this->{__METHOD__})) { $this->{__METHOD__} = df_float($this->value()); } return $this->{__METHOD__}; }
/** * @override * @param mixed $value * @throws \Zend_Filter_Exception * @return float */ public function filter($value) { /** @var float $result */ try { $result = df_float($value); } catch (\Exception $e) { df_error(new \Zend_Filter_Exception(df_ets($e))); } return $result; }
/** * 2016-08-26 * @param float|int|string $amount * @return string */ function dfp_last2($amount) { return substr(strval(round(100 * df_float($amount))), -2); }
/** * 2015-08-16 * Намеренно убрал параметр $default. * @param CX|null $e [optional] * @return float */ function df_leaf_f(CX $e = null) { return df_float(df_leaf($e)); }
/** * @param mixed $v * @param bool $allow0 [optional] * @param bool $throw [optional] * @return float|null * @throws DFE */ function df_float_positive($v, $allow0 = false, $throw = true) { /** @var float|null $result */ if (!$throw) { try { $result = df_float_positive($v, $allow0, true); } catch (Exception $e) { $result = null; } } else { /** @var float $result */ $result = df_float($v, $allow0); if ($allow0) { df_assert_ge(0.0, $result); } else { df_assert_gt0($result); } } return $result; }