An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
<?php
it('formats counts with K, M, and B suffixes', function (?int $input, string $expected) {
expect(compactNumber($input))->toBe($expected);
})->with([
'null' => [null, '0'],
'below a thousand' => [999, '999'],
'round thousand' => [1000, '1K'],
'thousands' => [26_360, '26.36K'],
'millions' => [1_200_000, '1.2M'],
'billions' => [3_456_789_012, '3.46B'],
]);