src/Encoder/FloatEncoder.php
private function encodeNumber($float, array $options, callable $encode)
    {
        if ($this->isInteger($float, $options['float.integers'])) {
            return $this->encodeInteger($float, $encode);
        } elseif ($float === 0.0) {
            return '0.0';
        } elseif ($options['float.export']) {
            return var_export((float) $float, true);
        }

        return $this->encodeFloat($float, $this->determinePrecision($options));
    }
private function encodeNumber($float, array $options, callable $encode)
    {
        if ($this->isInteger($float, $options['float.integers'])) {
            return $this->encodeInteger($float, $encode);
        } elseif ($float === 0.0) {
            return '0.0';
        } elseif ($options['float.export']) {
            return var_export((float) $float, true);
        }

        return $this->encodeFloat($float, $this->determinePrecision($options));
    }
private function encodeNumber ( $ float , array $ options , callable $ encode ) { if ( $ this -> isInteger ( $ float , $ options [ 'float.integers' ] ) ) { return $ this -> encodeInteger ( $ float , $ encode ) ; } elseif ( $ float === 0.0 ) { return '0.0' ; } elseif ( $ options [ 'float.export' ] ) { return var_export ( ( float ) $ float , true ) ; } return $ this -> encodeFloat ( $ float , $ this -> determinePrecision ( $ options ) ) ; }
Encodes the number as a PHP number representation.
@param float $float The number to encode
@param array $options The float encoding options
@param callable $encode Callback used to encode values
@return string The PHP code representation for the number
Encodes the number as a PHP number representation .