|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-10-13 11:30 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2020-10-13 11:30 UTC] cmb@php.net
[2020-10-25 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
Description: ------------ hi define("E", "\n"); $round = new \NumberFormatter("en", \NumberFormatter::ORDINAL); echo $round->format(6).E; // OUTPUTS 6th $round = new \NumberFormatter("en", \NumberFormatter::ORDINAL); echo var_dump($round->parse("6th")).E; // OUTPUTS float 122!!! echo $round->getErrorMessage().E; // ZERO ERROR gives me error only with "en-*" locale this works good: $round = new \NumberFormatter("it_IT", \NumberFormatter::ORDINAL); echo var_dump($round->parse("6°")).E; // OUTPUTS float 6 echo var_dump($round->parse("123esimo")).E; // OUTPUTS float 123 echo $round->getErrorMessage().E; // ZERO ERROR