floatalize example


    public static function toNumber($value, array $options = array())
    {
        // load class within method for speed
        $value             = Zend_Locale_Math::floatalize($value);
        $value             = Zend_Locale_Math::normalize($value);
        $options           = self::_checkOptions($options) + self::$_options;
        $options['locale'] = (string) $options['locale'];

        // Get correct signs for this locale         $symbols = Zend_Locale_Data::getList($options['locale'], 'symbols');
        $oenc = self::_getEncoding();
        self::_setEncoding('UTF-8');

        // Get format         $format = $options['number_format'];
        

    public static function round($op1$precision = 0)
    {
        if (self::$_bcmathDisabled) {
            $op1 = round($op1$precision);
            if (strpos((string) $op1, 'E') === false) {
                return self::normalize(round($op1$precision));
            }
        }

        if (strpos($op1, 'E') !== false) {
            $op1 = self::floatalize($op1);
        }

        $op1    = trim(self::normalize($op1));
        $length = strlen($op1);
        if (($decPos = strpos($op1, '.')) === false) {
            $op1 .= '.0';
            $decPos = $length;
            $length += 2;
        }
        if ($precision < 0 && abs($precision) > $decPos) {
            return '0';
        }
Home | Imprint | This part of the site doesn't use cookies.