mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
* Corrections to many issues found by QA scripts, as well as alignment of line numbers between en and pt_br xml files * Update to abandoned/outdated/missing pages in reference/filesystem/ * Correction to parameter 'filename' * Updates to abandoned/outdated/missing pages in reference/var/ * Updates to match recent revision in `en` pages * update to migration83/other-changes.xml according to last english revision * update to language/types/float.xml according to last `en` version * update to reference/calendar/constants.xml according to last `en`version --------- Co-authored-by: LEONARDO LARA RODRIGUES <leonardolara@github.com>
135 lines
3.6 KiB
XML
135 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: fca3920773bcf7ea2aa2f7306103f6d3d0e6b901 Maintainer: leonardolara Status: ready --><!-- CREDITS: felipe, fabioluciano, leonardolara -->
|
|
<refentry xml:id="function.floatval" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>floatval</refname>
|
|
<refpurpose>Obtém o valor em ponto flutuante da variável</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>float</type><methodname>floatval</methodname>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Obtém o valor <type>float</type> de <parameter>value</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Pode ser qualquer tipo escalar. <function>floatval</function> não deve ser utilizada
|
|
em objetos, pois isso ocasionará emissão de um erro de nível <constant>E_WARNING</constant>
|
|
e retornará 1.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
O valor em ponto flutuante da variável informada. Arrays vazios retornam 0, arrays
|
|
com valores retoram 1.
|
|
</para>
|
|
<para>
|
|
Strings provavelmente retornarão 0, embora esse comportamento dependa
|
|
dos caracteres à esquerda da string. A regra geral de
|
|
<link linkend="language.types.float.casting">conversão para ponto flutuante</link>
|
|
é aplicada.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
O nível de erro ao converter um objeto mudou de <constant>E_NOTICE</constant> para <constant>E_WARNING</constant>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo da função <function>floatval</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$var = '122.34343The';
|
|
$float_value_of_var = floatval($var);
|
|
echo $float_value_of_var; // 122.34343
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemplo da função <function>floatval</function> em string com caracteres não numéricos à esquerda</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$var = 'The122.34343';
|
|
$float_value_of_var = floatval($var);
|
|
echo $float_value_of_var; // 0
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>boolval</function></member>
|
|
<member><function>intval</function></member>
|
|
<member><function>strval</function></member>
|
|
<member><function>settype</function></member>
|
|
<member><link linkend="language.types.type-juggling">Manipulação de Tipos</link></member>
|
|
</simplelist>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|