Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fixing Types, Word and Returns of Numberclass. #49681

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/Illuminate/Support/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,26 @@ 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.
*
* @param int $number
* @param int|float $number
* @param int $precision
* @param int|null $maxPrecision
* @return string
* @return bool|string
*/
public static function abbreviate(int|float $number, int $precision = 0, ?int $maxPrecision = null)
{
return static::forHumans($number, $precision, $maxPrecision, abbreviate: true);
}

/**
* Convert the number to its human readable equivalent.
* Convert the number to its human-readable equivalent.
*
* @param int $number
* @param int|float $number
* @param int $precision
* @param int|null $maxPrecision
* @return string
* @param bool $abbreviate
* @return bool|string
*/
public static function forHumans(int|float $number, int $precision = 0, ?int $maxPrecision = null, bool $abbreviate = false)
{
Expand All @@ -182,13 +183,13 @@ 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|float $number
* @param int $precision
* @param int|null $maxPrecision
* @param array $units
* @return string
* @return string|false
*/
protected static function summarize(int|float $number, int $precision = 0, ?int $maxPrecision = null, array $units = [])
{
Expand Down