php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54294 wrong result when parse ::ORDINAL strings ->parse("2nd")
Submitted: 2011-03-17 15:00 UTC Modified: -
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: giorgio dot liscio at email dot it Assigned:
Status: Open Package: I18N and L10N related
PHP Version: 5.3.5 OS: all ? windows7 x64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: giorgio dot liscio at email dot it
New email:
PHP Version: OS:

 

 [2011-03-17 15:00 UTC] giorgio dot liscio at email dot it
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



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Oct 21 02:01:27 2019 UTC