mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document floatval as the main function, doubleval as the alias.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@57999 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c16899ed43
commit
5678ecd93b
1 changed files with 52 additions and 30 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.65 $ -->
|
||||
<!-- $Revision: 1.66 $ -->
|
||||
<reference id="ref.var">
|
||||
<title>Variable Functions</title>
|
||||
<titleabbrev>Variables</titleabbrev>
|
||||
|
@ -7,37 +7,21 @@
|
|||
<refentry id="function.doubleval">
|
||||
<refnamediv>
|
||||
<refname>doubleval</refname>
|
||||
<refpurpose>Get double value of a variable</refpurpose>
|
||||
<refpurpose>Alias of <function>floatval</function></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>float <function>doubleval</function></funcdef>
|
||||
<paramdef>mixed <parameter>var</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<simpara>
|
||||
Returns the double (floating point) value of
|
||||
<parameter>var</parameter>.
|
||||
</simpara>
|
||||
<para>
|
||||
<parameter>Var</parameter> may be any scalar type. You cannot use
|
||||
<function>doubleval</function> on arrays or objects.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
$var = '122.34343The';
|
||||
$double_value_of_var = doubleval ($var);
|
||||
print $double_value_of_var; // prints 122.34343
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
This function is an alias of <function>floatval</function>.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>intval</function>,
|
||||
<function>strval</function>, <function>settype</function> and
|
||||
<link linkend="language.types.type-juggling">Type
|
||||
juggling</link>.
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
This alias is a left-over from a function-renaming. In older versions of
|
||||
PHP you'll need to use this alias of the <function>floatval</function>
|
||||
function, because <function>floatval</function> wasn't yet available in
|
||||
that version.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -98,6 +82,42 @@ if (!isset($var)) { // evaluates false
|
|||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.floatval">
|
||||
<refnamediv>
|
||||
<refname>floatval</refname>
|
||||
<refpurpose>Get float value of a variable</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>float <function>floatval</function></funcdef>
|
||||
<paramdef>mixed <parameter>var</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<simpara>
|
||||
Returns the <type>float</type> value of <parameter>var</parameter>.
|
||||
</simpara>
|
||||
<para>
|
||||
<parameter>Var</parameter> may be any scalar type. You cannot use
|
||||
<function>floatval</function> on arrays or objects.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
$var = '122.34343The';
|
||||
$float_value_of_var = floatval ($var);
|
||||
print $float_value_of_var; // prints 122.34343
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>intval</function>,
|
||||
<function>strval</function>, <function>settype</function> and
|
||||
<link linkend="language.types.type-juggling">Type
|
||||
juggling</link>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.gettype">
|
||||
<refnamediv>
|
||||
<refname>gettype</refname>
|
||||
|
@ -304,7 +324,7 @@ echo get_resource_type($doc->doc)."\n";
|
|||
</para>
|
||||
</note>
|
||||
<simpara>
|
||||
See also <function>doubleval</function>,
|
||||
See also <function>floatval</function>,
|
||||
<function>strval</function>, <function>settype</function> and
|
||||
<link linkend="language.types.type-juggling">Type
|
||||
juggling</link>.
|
||||
|
@ -1008,7 +1028,9 @@ if (!odbc_execute ($stmt, &$sqldata)) {
|
|||
<itemizedlist>
|
||||
<listitem><simpara>"boolean"</simpara></listitem>
|
||||
<listitem><simpara>"integer"</simpara></listitem>
|
||||
<listitem><simpara>"double"</simpara></listitem>
|
||||
<listitem><simpara>"double" (this is for historical reasons only,
|
||||
"double" will be returned when the type is
|
||||
<type>float</type>.</simpara></listitem>
|
||||
<listitem><simpara>"string"</simpara></listitem>
|
||||
<listitem><simpara>"array"</simpara></listitem>
|
||||
<listitem><simpara>"object"</simpara></listitem>
|
||||
|
@ -1061,7 +1083,7 @@ settype($bar, "string"); // $bar is now "1" (string)
|
|||
<function>strval</function> on arrays or objects.
|
||||
</simpara>
|
||||
<simpara>
|
||||
See also <function>doubleval</function>,
|
||||
See also <function>floatval</function>,
|
||||
<function>intval</function>, <function>settype</function> and
|
||||
<link linkend="language.types.type-juggling">Type
|
||||
juggling</link>.
|
||||
|
|
Loading…
Reference in a new issue