php-doc-en/reference/var/functions/floatval.xml
2003-05-30 16:58:05 +00:00

61 lines
1.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.66 -->
<refentry id="function.floatval">
<refnamediv>
<refname>floatval</refname>
<refpurpose>Get float value of a variable</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>float</type><methodname>floatval</methodname>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
<?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>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->