Use NumberFormatter instead of legacy NumberFormat
Đang mở
@devnexen đang làm issue này rồi.
Từ ngày 6/12/2024.
Extension: intl
Feature
Status: Needs Triage
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.1k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
Description
The following code:
<?PHP
function nth(int $number) : ?string {
$formatter = new \NumberFormatter('en_US', \NumberFormatter::ORDINAL);
$formatted = $formatter->format($number);
return $formatted === false ? null : $formatted;
}
echo nth(651959195189);
?>
Resulted in this output:
651,959,195,189rd
But I expected this output instead:
651,959,195,189th
PHP Version
PHP 8.3.6
Operating System
Linux Mint 22
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.