1
0
mirror of https://github.com/php/doc-pl.git synced 2026-03-24 07:02:07 +01:00
Files
archived-doc-pl/reference/var/functions/floatval.xml
Grzegorz Bańkowski ed360c0616 Sync reference/xml, var, url, tidy, strings, session, uodbc with EN (#5)
* Sync reference/xml, var, url, tidy, strings, session, uodbc with EN

* Delete unnecessary char from session-module-name.xml file

* Small change in session, tidy, url, var functions files
2024-05-22 18:25:41 +02:00

137 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: fca3920773bcf7ea2aa2f7306103f6d3d0e6b901 Maintainer: sobak Status: ready -->
<!-- $Revision$ -->
<!-- CREDITS: sobak, grzesiek -->
<refentry xml:id="function.floatval" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>floatval</refname>
<refpurpose>Pobiera wartość zmiennoprzecinkową zmiennej</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>float</type><methodname>floatval</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Pobiera wartość zmiennej <parameter>value</parameter> jako typ <type>float</type>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
Może być dowolnym typem skalarnym. <function>floatval</function> nie powinno
być używane na obiektach - w takim wypadku zostanie wyemitowany błąd poziomu
<constant>E_WARNING</constant>, a funkcja zwróci 1.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Wartość zmiennoprzecinkowa podanej zmiennej. Puste tablice zwracają 0,
a niepuste tablice 1.
</para>
<para>
Łańcuchy znaków prawdopodobnie zwrócą 0, jednak zależy to od
pierwszych od lewej znaków łańcucha. Zastosowanie mają ogólne
zasady
<link linkend="language.types.float.casting">rzutowania na float</link>.
</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>
Poziom błędu podczas konwersji z obiektu został zmieniony z <constant>E_NOTICE</constant> na <constant>E_WARNING</constant>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Przykład użycia <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><function>floatval</function> i znaki nienumeryczne na początku łańcucha</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">Przemienność typów</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
-->