From b984e12b07a0a0929807df328aa6fb33409f330f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 4 Dec 2023 12:32:33 +0100 Subject: [PATCH] Document new helper --- README.md | 3 +++ src/Number.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1fab239..ff2685e 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,9 @@ echo Number::format(1234567.89); // 1 KB // Get a human-readable representation of a number echo Number::format(1234567.89); // 1 million + +// Get the abbreviated form of a number +echo Number::format(1234567.89); // 1M ``` ### Advanced usage diff --git a/src/Number.php b/src/Number.php index 101c26a..fc6a7e7 100644 --- a/src/Number.php +++ b/src/Number.php @@ -120,7 +120,7 @@ public static function fileSize(int|float $bytes, int $precision = 0, ?int $maxP } /** - * Convert the number to its human-readable equivalent. + * Convert the number to its human-readable equivalent with abbreviated units. * * @param int|float $number * @param int $precision @@ -133,7 +133,7 @@ public static function abbreviate(int|float $number, int $precision = 0, ?int $m } /** - * Convert the number to its human readable equivalent. + * Convert the number to its human-readable equivalent. * * @param int $number * @param int $precision @@ -158,7 +158,7 @@ public static function forHumans(int|float $number, int $precision = 0, ?int $ma } /** - * Convert the number to its human readable equivalent. + * Convert the number to its human-readable equivalent. * * @param int $number * @param int $precision