PHP code example of sikandarmoyaldev / indian-amount-formatter
1. Go to this page and download the library: Download sikandarmoyaldev/indian-amount-formatter 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/ */
sikandarmoyaldev / indian-amount-formatter example snippets
use Sikandarmoyaldev\IndianAmountFormatter\InrFormatter as Inr;
echo Inr::formatAmount(200000); // Output: ₹2 Lakh
echo Inr::formatAmount(4999); // Output: ₹4.99K
echo Inr::formatAmount(null); // Output: Unlimited
echo Inr::formatPercentage(3.5); // Output: 3.5%
echo Inr::formatAmountRange(100000, 500000); // Output: ₹1 Lakh - ₹5 Lakh
echo Inr::formatAmountWithActual(140000); // Output: ₹1.4 Lakh (₹1,40,000)