Skip to content

Commit 0a51c06

Browse files
committed
numberToReadable will return an int if the $shorthand is empty.
1 parent 3a778ca commit 0a51c06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Interaction.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ static public function numberToReadable($number, $precision = 1, $divisors = nul
221221
}
222222
}
223223

224-
return number_format($number / $divisor, $precision).$shorthand;
224+
$precision = empty($shorthand) ? 0 : $precision;
225+
226+
return number_format($number / $divisor, $precision) . $shorthand;
225227
}
226228

227229

0 commit comments

Comments
 (0)