From 4f291d03c563bf8b42c0334dcad25f5f72fae0be Mon Sep 17 00:00:00 2001 From: Caleb Mazalevskis Date: Wed, 26 Jun 2024 15:08:34 +0800 Subject: [PATCH] Refactor. --- README.md | 6 +++--- src/NumberFormatter.php | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d85bfe..2b36a51 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![v1: PHP >= 5.4](https://img.shields.io/badge/v1-PHP%20%3E%3D%205.4-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/) -[![v2: PHP >= 7.2](https://img.shields.io/badge/v2-PHP%20%3E%3D%207.2-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/) +![v1: PHP >= 5.4 < 8.4](https://img.shields.io/badge/v1-PHP%20%3E%3D%205.4%20%3C%208.4-8892bf.svg) +![v2: PHP >= 7.2](https://img.shields.io/badge/v2-PHP%20%3E%3D%207.2-8892bf.svg) [![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) ## Common Classes Package. @@ -53,4 +53,4 @@ Please use the issues page of this repository. --- -Last Updated: 14 September 2023 (2023.09.14). +Last Updated: 31 May 2024 (2024.05.31). diff --git a/src/NumberFormatter.php b/src/NumberFormatter.php index 71a75f3..94b7690 100644 --- a/src/NumberFormatter.php +++ b/src/NumberFormatter.php @@ -1302,8 +1302,7 @@ public function format($Number, int $Decimals = 0): string } else { $WholeLen = strlen($Number); } - $OddEven = 'o'; - for ($Unit = 0, $Formatted = '', $ThouPos = $this->GroupOffset, $Pos = $WholeLen - 1; $Pos > -1; $Pos--, $Unit++, $OddEven = $OddEven === 'o' ? 'e' : 'o') { + for ($OddEven = 'o', $Unit = 0, $Formatted = '', $ThouPos = $this->GroupOffset, $Pos = $WholeLen - 1; $Pos > -1; $Pos--, $Unit++, $OddEven = $OddEven === 'o' ? 'e' : 'o') { if ($ThouPos >= $this->GroupSize) { $ThouPos = 1; $Formatted = $this->GroupSeparator . $Formatted;