@@ -251,6 +251,10 @@ public function testToHuman()
251251 $ this ->assertSame ('-1.1 trillion ' , Number::forHumans (-1100000000000 , maxPrecision: 1 ));
252252 $ this ->assertSame ('-1 quadrillion ' , Number::forHumans (-1000000000000000 ));
253253 $ this ->assertSame ('-1 thousand quadrillion ' , Number::forHumans (-1000000000000000000 ));
254+
255+ $ this ->assertSame ('999 thousand ' , Number::forHumans (999499 ));
256+ $ this ->assertSame ('1 million ' , Number::forHumans (999500 ));
257+ $ this ->assertSame ('1 million ' , Number::forHumans (999999 ));
254258 }
255259
256260 public function testSummarize ()
@@ -307,6 +311,15 @@ public function testSummarize()
307311 $ this ->assertSame ('-1.1T ' , Number::abbreviate (-1100000000000 , maxPrecision: 1 ));
308312 $ this ->assertSame ('-1Q ' , Number::abbreviate (-1000000000000000 ));
309313 $ this ->assertSame ('-1KQ ' , Number::abbreviate (-1000000000000000000 ));
314+
315+ $ this ->assertSame ('999K ' , Number::abbreviate (999499 ));
316+ $ this ->assertSame ('1M ' , Number::abbreviate (999500 ));
317+ $ this ->assertSame ('1M ' , Number::abbreviate (999999 ));
318+ $ this ->assertSame ('1B ' , Number::abbreviate (999500000 ));
319+ $ this ->assertSame ('1B ' , Number::abbreviate (999999999 ));
320+
321+ Number::withLocale ('de ' , fn () => $ this ->assertSame ('1M ' , Number::abbreviate (999500 )));
322+ Number::withLocale ('fr ' , fn () => $ this ->assertSame ('1M ' , Number::abbreviate (999500 )));
310323 }
311324
312325 public function testPairs ()
0 commit comments