php / php/php-src

Use NumberFormatter instead of legacy NumberFormat

オープン
#17,006 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

@devnexen がすでに取り組んでいます。

2024年12月6日 から。

Extension: intl Feature Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。