Doc #73895 [Opn->Nab]: Missing format variation
| From: | requinix@php.net | Date: | Mon, 09 Jan 2017 10:48:24 +0000 |
| Subject: | Doc #73895 [Opn->Nab]: Missing format variation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14318@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73895&edit=1
ID: 73895
Updated by: requinix@php.net
Reported by: h dot larget at gmail dot com
Summary: Missing format variation
-Status: Open
+Status: Not a bug
Type: Documentation Problem
-Package: Documentation problem
+Package: *Math Functions
Operating System: Ubuntu 16.04 LTS
PHP Version: 7.0.14
Block user comment: N
Private report: N
New Comment:
It is not mentioned because it has nothing to do with round(). The comma is introduced when the
floating-point value is converted to string.
http://php.net/manual/en/language.types.string.php#language.types.string.casting
echo 2.447; // 2.447
echo (string)2.447; // 2,447 with an appropriate locale
Previous Comments:
------------------------------------------------------------------------
[2017-01-09 10:33:02] h dot larget at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.round
---
It is not specified that depending on php locale, the dot is replaced by comma.
it should not have this kind of behavior or being specified in the documentation.
Test script:
---------------
<?php echo "<br/>".round(2.447,2);
Expected result:
----------------
<br/>2.45
Actual result:
--------------
<br/>2,45
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73895&edit=1