PHP code example of bariscodefx / php-number-format-kmt
1. Go to this page and download the library: Download bariscodefx/php-number-format-kmt library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bariscodefx / php-number-format-kmt example snippets
use PHPNumberFormatKMT\NumberFormatKMT;
echo NumberFormatKMT::format(1000); // 1 K
echo NumberFormatKMT::format(1000, discriminator: ''); // 1K
echo NumberFormatKMT::format(1111); // 1.1 K
echo NumberFormatKMT::format(1111, precision: 2); // 1.11 K