PHPackages                             laxmidhar/desi-currency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. laxmidhar/desi-currency

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laxmidhar/desi-currency
=======================

A little toolkit that teaches Laravel to count in rupees — because not every app runs on dollars.

v1.1.0(8mo ago)16MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Oct 17Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/dante-san/desi-currency)[ Packagist](https://packagist.org/packages/laxmidhar/desi-currency)[ Docs](https://github.com/dante-san/desi-currency)[ RSS](/packages/laxmidhar-desi-currency/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Desi Currency - Indian Currency Helper for Laravel
==================================================

[](#desi-currency---indian-currency-helper-for-laravel)

 [![Latest Version](https://camo.githubusercontent.com/b4825c4762a17d0be461b02745eed8d670bb0f86e550796e46823ebba6ee17ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61786d69646861722f646573692d63757272656e63793f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/b4825c4762a17d0be461b02745eed8d670bb0f86e550796e46823ebba6ee17ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61786d69646861722f646573692d63757272656e63793f7374796c653d666c61742d737175617265) [![Total Downloads](https://camo.githubusercontent.com/bafee38694c6aa867c9abf1747ea5980e17738fb3234b8a4ee573a76fd8ecfb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61786d69646861722f646573692d63757272656e63793f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/bafee38694c6aa867c9abf1747ea5980e17738fb3234b8a4ee573a76fd8ecfb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61786d69646861722f646573692d63757272656e63793f7374796c653d666c61742d737175617265) [![License](https://camo.githubusercontent.com/41204a3cc34b998a824e48af5b86cdf17819f122424ee906c92ec84db263a88a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61786d69646861722f646573692d63757272656e63793f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/41204a3cc34b998a824e48af5b86cdf17819f122424ee906c92ec84db263a88a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61786d69646861722f646573692d63757272656e63793f7374796c653d666c61742d737175617265) [![Laravel Version](https://camo.githubusercontent.com/c269eced0ddecdd13796596903465cea85419125e489835743683f690c5ed0a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d392e7825323025374325323031302e7825323025374325323031312e7825323025374325323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://camo.githubusercontent.com/c269eced0ddecdd13796596903465cea85419125e489835743683f690c5ed0a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d392e7825323025374325323031302e7825323025374325323031312e7825323025374325323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)

A comprehensive Laravel package for handling Indian currency formatting, conversions, and utilities. Format amounts in Lakhs, Crores, convert to words, parse shorthand notations (1L, 2.5Cr), and much more - all following Indian numbering standards.

---

✨ Features
----------

[](#-features)

- 🇮🇳 **Indian Numbering System** - Proper comma placement (₹1,23,456.78)
- 💰 **Lakh &amp; Crore Formatting** - Convert to Lakhs, Crores with ease
- 🔤 **Words Conversion** - Amount to Indian words (One Lakh Twenty Three Thousand)
- 📝 **Shorthand Support** - Parse and format 1L, 2.5Cr, 500K notations
- 🔄 **Two-way Conversion** - Format to shorthand and parse back to numbers
- ✅ **Zero Configuration** - Works out of the box
- 🎯 **Production Ready** - Fully tested and optimized
- 📦 **Auto-Discovery** - Automatically registers with Laravel

---

📋 Requirements
--------------

[](#-requirements)

- PHP 8.0 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x

---

🚀 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require laxmidhar/desi-currency
```

The service provider will be automatically registered via Laravel's package auto-discovery.

---

📖 Usage
-------

[](#-usage)

### Facade Usage (Recommended)

[](#facade-usage-recommended)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

// Format in Indian style
Currency::format(123456.78);
// Output: "₹1,23,456.78"

// Convert to words
Currency::toWords(150000);
// Output: "₹1.5 Lakh"

// Shorthand notation
Currency::toShorthand(2500000);
// Output: "₹25L"

// Parse back to number
Currency::parse('1.5L');
// Output: 150000
```

### Direct Class Usage

[](#direct-class-usage)

```
use Laxmidhar\DesiCurrency\Support\CurrencyService;

CurrencyService::format(123456.78);
CurrencyService::toWords(150000);
CurrencyService::toShorthand(2500000);
```

### Dependency Injection

[](#dependency-injection)

```
use Laxmidhar\DesiCurrency\Support\CurrencyService;

class InvoiceController extends Controller
{
    public function __construct(protected CurrencyService $currency) {}

    public function show($id)
    {
        $invoice = Invoice::find($id);
        $formatted = $this->currency->format($invoice->total);
        $inWords = $this->currency->toIndianWords($invoice->total);

        return view('invoice.show', compact('invoice', 'formatted', 'inWords'));
    }
}
```

---

🧩 Available Methods
-------------------

[](#-available-methods)

### 💰 Core Formatting Methods

[](#-core-formatting-methods)

#### `format(float $amount, bool $showSymbol = true): string`

[](#formatfloat-amount-bool-showsymbol--true-string)

Format amount using Indian numbering system (₹1,23,456.78).

**Parameters:**

- `$amount` - Amount to format
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::format(1234.56);
// Output: "₹1,234.56"

Currency::format(123456.78);
// Output: "₹1,23,456.78"

Currency::format(12345678.90);
// Output: "₹1,23,45,678.90"

Currency::format(1234.56, false);
// Output: "1,234.56"

Currency::format(-5000);
// Output: "-₹5,000.00"
```

**Key Features:**

- Follows Indian comma placement (last 3 digits, then groups of 2)
- Handles negative amounts
- Always shows 2 decimal places
- Optional currency symbol

---

#### `formatWhole(float $amount, bool $showSymbol = true): string`

[](#formatwholefloat-amount-bool-showsymbol--true-string)

Format amount without decimal places.

**Parameters:**

- `$amount` - Amount to format
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::formatWhole(123456.78);
// Output: "₹1,23,457"

Currency::formatWhole(1234.50);
// Output: "₹1,235"

Currency::formatWhole(1000000);
// Output: "₹10,00,000"

Currency::formatWhole(1234.56, false);
// Output: "1,235"
```

**Use Cases:**

- Display whole rupees only
- Invoice totals
- Round number displays
- Reports and summaries

---

#### `formatAccounting(float $amount, bool $showSymbol = true): string`

[](#formataccountingfloat-amount-bool-showsymbol--true-string)

Format for accounting purposes (negative values in parentheses).

**Parameters:**

- `$amount` - Amount to format
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::formatAccounting(1000);
// Output: "₹1,000.00"

Currency::formatAccounting(-1000);
// Output: "(₹1,000.00)"

Currency::formatAccounting(-25000.50);
// Output: "(₹25,000.50)"
```

**Use Cases:**

- Financial statements
- Balance sheets
- Profit/Loss reports
- Accounting software

---

### 🔤 Words &amp; Shorthand Conversion

[](#-words--shorthand-conversion)

#### `toWords(float $amount, bool $showSymbol = true): string`

[](#towordsfloat-amount-bool-showsymbol--true-string)

Convert amount to readable words format (Lakh, Crore, K).

**Parameters:**

- `$amount` - Amount to convert
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::toWords(500);
// Output: "₹500"

Currency::toWords(5000);
// Output: "₹5K"

Currency::toWords(50000);
// Output: "₹50K"

Currency::toWords(150000);
// Output: "₹1.5 Lakh"

Currency::toWords(2500000);
// Output: "₹25 Lakh"

Currency::toWords(15000000);
// Output: "₹1.5 Crore"

Currency::toWords(250000000);
// Output: "₹25 Crore"

Currency::toWords(150000, false);
// Output: "1.5 Lakh"
```

**Conversion Logic:**

- ≥ 1 Crore (10,000,000): Shows in Crores
- ≥ 1 Lakh (100,000): Shows in Lakhs
- ≥ 1 Thousand (1,000): Shows with K suffix
- &lt; 1 Thousand: Shows as is

---

#### `toShorthand(float $amount, bool $showSymbol = true): string`

[](#toshorthandfloat-amount-bool-showsymbol--true-string)

Convert to compact shorthand notation (1L, 2.5Cr, 500K).

**Parameters:**

- `$amount` - Amount to convert
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::toShorthand(500);
// Output: "₹500"

Currency::toShorthand(5000);
// Output: "₹5K"

Currency::toShorthand(150000);
// Output: "₹1.5L"

Currency::toShorthand(2500000);
// Output: "₹25L"

Currency::toShorthand(15000000);
// Output: "₹1.5Cr"

Currency::toShorthand(250000000);
// Output: "₹25Cr"

Currency::toShorthand(-150000);
// Output: "-₹1.5L"
```

**Use Cases:**

- Dashboard widgets
- Mobile app displays
- Quick summaries
- Data tables
- Charts and graphs

---

#### `toLakhs(float $amount, int $decimals = 2, bool $showSymbol = true): string`

[](#tolakhsfloat-amount-int-decimals--2-bool-showsymbol--true-string)

Always format in Lakhs, regardless of amount.

**Parameters:**

- `$amount` - Amount to convert
- `$decimals` - Number of decimal places (default: 2)
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::toLakhs(50000);
// Output: "₹0.50 Lakhs"

Currency::toLakhs(150000);
// Output: "₹1.50 Lakhs"

Currency::toLakhs(2500000);
// Output: "₹25.00 Lakhs"

Currency::toLakhs(15000000);
// Output: "₹150.00 Lakhs"

Currency::toLakhs(150000, 1);
// Output: "₹1.5 Lakhs"

Currency::toLakhs(100000);
// Output: "₹1.00 Lakh"

Currency::toLakhs(150000, 2, false);
// Output: "1.50 Lakhs"
```

**Use Cases:**

- Real estate pricing
- Salary negotiations
- Project budgets
- Property valuations

---

#### `toCrores(float $amount, int $decimals = 2, bool $showSymbol = true): string`

[](#tocroresfloat-amount-int-decimals--2-bool-showsymbol--true-string)

Always format in Crores, regardless of amount.

**Parameters:**

- `$amount` - Amount to convert
- `$decimals` - Number of decimal places (default: 2)
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::toCrores(5000000);
// Output: "₹0.50 Crores"

Currency::toCrores(15000000);
// Output: "₹1.50 Crores"

Currency::toCrores(250000000);
// Output: "₹25.00 Crores"

Currency::toCrores(15000000, 1);
// Output: "₹1.5 Crores"

Currency::toCrores(10000000);
// Output: "₹1.00 Crore"

Currency::toCrores(15000000, 2, false);
// Output: "1.50 Crores"
```

**Use Cases:**

- Company valuations
- Large transactions
- Annual reports
- Government budgets
- Infrastructure projects

---

#### `toIndianWords(float $amount): string`

[](#toindianwordsfloat-amount-string)

Convert amount to complete Indian words format.

**Parameters:**

- `$amount` - Amount to convert

**Examples:**

```
Currency::toIndianWords(123);
// Output: "One Hundred Twenty Three Rupees"

Currency::toIndianWords(1234.50);
// Output: "One Thousand Two Hundred Thirty Four Rupees and Fifty Paise"

Currency::toIndianWords(123456);
// Output: "One Lakh Twenty Three Thousand Four Hundred Fifty Six Rupees"

Currency::toIndianWords(12345678);
// Output: "One Crore Twenty Three Lakh Forty Five Thousand Six Hundred Seventy Eight Rupees"

Currency::toIndianWords(100.25);
// Output: "One Hundred Rupees and Twenty Five Paise"

Currency::toIndianWords(-500);
// Output: "Negative Five Hundred Rupees"
```

**Use Cases:**

- Cheque printing
- Invoice generation
- Legal documents
- Payment receipts
- Bank transactions

---

### 🔄 Parsing &amp; Conversion

[](#-parsing--conversion)

#### `parse(string $amount): float`

[](#parsestring-amount-float)

Parse Indian currency notation back to numeric value.

**Parameters:**

- `$amount` - String amount to parse

**Examples:**

```
Currency::parse('1L');
// Output: 100000

Currency::parse('1.5L');
// Output: 150000

Currency::parse('2.5Cr');
// Output: 25000000

Currency::parse('500K');
// Output: 500000

Currency::parse('1 Lakh');
// Output: 100000

Currency::parse('2.5 Crore');
// Output: 25000000

Currency::parse('₹1.5L');
// Output: 150000

Currency::parse('Rs 2.5Cr');
// Output: 25000000

Currency::parse('-1.5L');
// Output: -150000

Currency::parse('1,50,000');
// Output: 150000
```

**Supported Formats:**

- Shorthand: 1L, 2.5Cr, 500K
- Words: 1 Lakh, 2.5 Crore
- With symbols: ₹1L, Rs 2Cr
- With commas: 1,50,000
- Negative values: -1.5L

**Use Cases:**

- User input parsing
- Import data processing
- API integrations
- Form submissions

---

### 🔧 Utility Methods

[](#-utility-methods)

#### `symbol(): string`

[](#symbol-string)

Get the rupee currency symbol.

**Examples:**

```
Currency::symbol();
// Output: "₹"

// Usage in views
echo Currency::symbol() . '1,000';
// Output: "₹1,000"
```

---

#### `splitRupeesPaise(float $amount): array`

[](#splitrupeespaisefloat-amount-array)

Split amount into rupees and paise components.

**Parameters:**

- `$amount` - Amount to split

**Examples:**

```
Currency::splitRupeesPaise(1234.56);
// Output: ['rupees' => 1234, 'paise' => 56]

Currency::splitRupeesPaise(100.25);
// Output: ['rupees' => 100, 'paise' => 25]

Currency::splitRupeesPaise(500);
// Output: ['rupees' => 500, 'paise' => 0]

Currency::splitRupeesPaise(-1234.56);
// Output: ['rupees' => -1234, 'paise' => 56]

// Usage example
$split = Currency::splitRupeesPaise(1234.56);
echo "Rupees: {$split['rupees']}, Paise: {$split['paise']}";
// Output: "Rupees: 1234, Paise: 56"
```

**Use Cases:**

- Cheque printing
- Detailed invoices
- Payment breakdowns
- Accounting entries

---

#### `formatWithSuffix(float $amount, string $suffix = '', bool $showSymbol = true): string`

[](#formatwithsuffixfloat-amount-string-suffix---bool-showsymbol--true-string)

Format amount with custom suffix.

**Parameters:**

- `$amount` - Amount to format
- `$suffix` - Custom suffix text
- `$showSymbol` - Whether to include ₹ symbol (default: true)

**Examples:**

```
Currency::formatWithSuffix(1000, 'per month');
// Output: "₹1,000.00 per month"

Currency::formatWithSuffix(50000, 'annual');
// Output: "₹50,000.00 annual"

Currency::formatWithSuffix(25000, 'onwards');
// Output: "₹25,000.00 onwards"

Currency::formatWithSuffix(100000, 'only');
// Output: "₹1,00,000.00 only"

Currency::formatWithSuffix(1000);
// Output: "₹1,000.00"
```

**Use Cases:**

- Subscription pricing
- Product pricing
- EMI displays
- Offer pricing

---

#### `isLakhsRange(float $amount): bool`

[](#islakhsrangefloat-amount-bool)

Check if amount is in the Lakhs range (1L to 1Cr).

**Parameters:**

- `$amount` - Amount to check

**Examples:**

```
Currency::isLakhsRange(50000);
// Output: false (less than 1 Lakh)

Currency::isLakhsRange(150000);
// Output: true (1.5 Lakhs)

Currency::isLakhsRange(2500000);
// Output: true (25 Lakhs)

Currency::isLakhsRange(15000000);
// Output: false (1.5 Crores)

// Usage example
$amount = 250000;
if (Currency::isLakhsRange($amount)) {
    echo Currency::toLakhs($amount);
} else {
    echo Currency::format($amount);
}
```

**Use Cases:**

- Conditional formatting
- Range-based displays
- Report categorization

---

#### `isCroresRange(float $amount): bool`

[](#iscroresrangefloat-amount-bool)

Check if amount is in the Crores range (≥1Cr).

**Parameters:**

- `$amount` - Amount to check

**Examples:**

```
Currency::isCroresRange(5000000);
// Output: false (50 Lakhs)

Currency::isCroresRange(10000000);
// Output: true (1 Crore)

Currency::isCroresRange(250000000);
// Output: true (25 Crores)

// Usage example
$amount = 15000000;
if (Currency::isCroresRange($amount)) {
    echo Currency::toCrores($amount);
} else {
    echo Currency::toLakhs($amount);
}
```

**Use Cases:**

- Large transaction handling
- Report filtering
- Display logic

---

💡 Practical Examples
--------------------

[](#-practical-examples)

### E-commerce Product Display

[](#e-commerce-product-display)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

// Product price formatting
$product = Product::find(1);
$price = $product->price; // 149900

// For display
echo Currency::toShorthand($price);
// Output: "₹1.5L"

// For detailed view
echo Currency::format($price);
// Output: "₹1,49,900.00"

// For cards/widgets
echo Currency::toWords($price);
// Output: "₹1.5 Lakh"
```

---

### Invoice Generation

[](#invoice-generation)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

$invoice = Invoice::find(1);
$total = $invoice->total; // 125750.50

// Invoice total
echo Currency::format($total);
// Output: "₹1,25,750.50"

// Amount in words
echo Currency::toIndianWords($total);
// Output: "One Lakh Twenty Five Thousand Seven Hundred Fifty Rupees and Fifty Paise"

// Split for detailed view
$split = Currency::splitRupeesPaise($total);
echo "Rupees: {$split['rupees']}, Paise: {$split['paise']}";
// Output: "Rupees: 125750, Paise: 50"
```

---

### Dashboard Statistics

[](#dashboard-statistics)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

// Annual revenue
$revenue = 125000000; // 12.5 Crores

echo Currency::toShorthand($revenue);
// Output: "₹12.5Cr"

// Monthly revenue
$monthly = $revenue / 12;

if (Currency::isCroresRange($monthly)) {
    echo Currency::toCrores($monthly);
} else {
    echo Currency::toLakhs($monthly);
}
// Output: "₹1.04 Crores"
```

---

### Salary Package Display

[](#salary-package-display)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

$salary = 1800000; // 18 Lakhs per annum

// Annual
echo Currency::toLakhs($salary) . ' per annum';
// Output: "₹18.00 Lakhs per annum"

// Monthly
$monthly = $salary / 12;
echo Currency::format($monthly) . ' per month';
// Output: "₹1,50,000.00 per month"
```

---

### User Input Processing

[](#user-input-processing)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

// User enters "2.5L" in a form
$userInput = request('budget'); // "2.5L"

// Parse to numeric value
$numericValue = Currency::parse($userInput);
// Output: 250000

// Store in database
$property->budget = $numericValue;
$property->save();

// Display back to user
echo Currency::toWords($property->budget);
// Output: "₹2.5 Lakh"
```

---

### Financial Reports

[](#financial-reports)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

$profit = 5500000;
$loss = -1200000;

// Profit
echo Currency::formatAccounting($profit);
// Output: "₹55,00,000.00"

// Loss
echo Currency::formatAccounting($loss);
// Output: "(₹12,00,000.00)"

// Summary
echo Currency::toShorthand($profit);
// Output: "₹55L"
```

---

### Real Estate Listings

[](#real-estate-listings)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

$properties = Property::all();

foreach ($properties as $property) {
    $price = $property->price;

    // Display appropriate format based on range
    if (Currency::isCroresRange($price)) {
        echo $property->title . ': ' . Currency::toCrores($price);
    } else if (Currency::isLakhsRange($price)) {
        echo $property->title . ': ' . Currency::toLakhs($price);
    } else {
        echo $property->title . ': ' . Currency::format($price);
    }
}

// Output examples:
// "Luxury Villa: ₹2.50 Crores"
// "2BHK Apartment: ₹45.00 Lakhs"
// "Plot: ₹25,00,000.00"
```

---

### Blade Templates

[](#blade-templates)

```
{{-- Simple formatting --}}
Price: {{ Currency::format($product->price) }}

{{-- Shorthand for cards --}}

    {{ Currency::toShorthand($product->price) }}

{{-- Invoice display --}}

    Total: {{ Currency::format($invoice->total) }}
    {{ Currency::toIndianWords($invoice->total) }}

{{-- Conditional display --}}
@if(Currency::isCroresRange($amount))
    {{ Currency::toCrores($amount) }}
@else
    {{ Currency::toLakhs($amount) }}
@endif
```

---

🎨 Blade Directives
------------------

[](#-blade-directives)

Desi Currency provides convenient Blade directives for use in your Laravel views, making currency formatting clean and readable.

### Quick Reference Table

[](#quick-reference-table)

DirectivePurposeInput ExampleOutput Example`@currency($amount)`Standard format with symbol`123456.78``₹1,23,456.78``@currencyWhole($amount)`Format without decimals`123456.78``₹1,23,457``@currencyPlain($amount)`Format without symbol`123456.78``1,23,456.78``@currencyAccounting($amount)`Accounting format`-5000``(₹5,000.00)``@inLakhs($amount)`Always show in Lakhs`1500000``₹15.00 Lakhs``@inCrores($amount)`Always show in Crores`15000000``₹1.50 Crores``@currencyShort($amount)`Compact notation`1500000``₹15L``@currencyWords($amount)`Readable format`1500000``₹15 Lakh``@currencySpell($amount)`Full words`123456``One Lakh Twenty Three Thousand...``@rupeeSymbol`Rupee symbol only-`₹``@inLakhRange($amount)`Check Lakh range`500000``true/false``@inCroreRange($amount)`Check Crore range`15000000``true/false`---

### Available Directives

[](#available-directives)

#### Standard Formatting

[](#standard-formatting)

**@currency($amount)** - Format with Indian numbering and ₹ symbol

```
Total: @currency($invoice->total)

```

**@currencyWhole($amount)** - Format without decimals

```
Price: @currencyWhole($product->price)

```

**@currencyPlain($amount)** - Format without currency symbol

```
@currencyPlain($amount)

```

**@currencyAccounting($amount)** - Accounting format (negatives in parentheses)

```
Balance: @currencyAccounting($balance)

```

---

#### Indian Units (Lakh &amp; Crore)

[](#indian-units-lakh--crore)

**@inLakhs($amount)** - Always display in Lakhs

```
@inLakhs($package)

```

**@inCrores($amount)** - Always display in Crores

```
Revenue: @inCrores($revenue)

```

---

#### Shorthand &amp; Words

[](#shorthand--words)

**@currencyShort($amount)** - Compact notation (L, Cr, K)

```
@currencyShort($value)

```

**@currencyWords($amount)** - Readable format (Lakh, Crore)

```
Budget: @currencyWords($budget)

```

**@currencySpell($amount)** - Complete Indian words

```
Amount in words: @currencySpell($total)

```

---

#### Utilities

[](#utilities)

**@rupeeSymbol** - Just the rupee symbol

```
Price: @rupeeSymbol @currencyPlain($price)

```

---

### Conditional Directives

[](#conditional-directives)

Use these to conditionally render based on amount range:

**@inLakhRange($amount)** - Check if amount is in Lakh range (1L - 1Cr)

```
@inLakhRange($property->price)
    @inLakhs($property->price)
@else
    @currency($property->price)
@endinLakhRange
```

**@inCroreRange($amount)** - Check if amount is in Crore range (≥1Cr)

```
@inCroreRange($deal->value)
    @inCrores($deal->value)
@endinCroreRange
```

---

### Practical Blade Examples

[](#practical-blade-examples)

#### Product Card

[](#product-card)

```

    {{ $product->name }}

    @inCroreRange($product->price)
        @inCrores($product->price)
    @elseInLakhRange($product->price)
        @inLakhs($product->price)
    @else
        @currency($product->price)
    @endinCroreRange

    @currencyShort($product->price)

```

#### Invoice Template

[](#invoice-template)

```

        @foreach($items as $item)

                {{ $item->description }}
                @currency($item->amount)

        @endforeach

            Total
            @currency($invoice->total)

        @currencySpell($invoice->total)

```

#### Dashboard Widget

[](#dashboard-widget)

```

    Monthly Revenue
    @currencyShort($revenue)
    @currencyWords($revenue)

```

#### Financial Report

[](#financial-report)

```

        Revenue
        @currencyAccounting($revenue)

        Expenses
        @currencyAccounting(-$expenses)

        Profit/Loss
        @currencyAccounting($profit)

```

#### Salary Package Display

[](#salary-package-display-1)

```

        Annual Package:
        @inLakhs($salary->annual)

        Monthly:
        @currency($salary->monthly)

        (@currencyShort($salary->annual) per year)

```

---

🎯 Best Practices
----------------

[](#-best-practices)

### 1. **Consistent Display**

[](#1-consistent-display)

Use the same format throughout your application for consistency:

```
// Good: Consistent format
echo Currency::toShorthand($amount); // Throughout app

// Avoid: Mixing formats randomly
echo Currency::format($amount);
echo Currency::toWords($amount);
```

---

### 2. **Store as Numeric, Display as Formatted**

[](#2-store-as-numeric-display-as-formatted)

Always store amounts as numeric values in database:

```
// Storage (numeric)
$product->price = 150000;

// Display (formatted)
echo Currency::toWords($product->price);
```

---

### 3. **Handle User Input Properly**

[](#3-handle-user-input-properly)

Parse user input before storing:

```
$input = request('amount'); // "1.5L"
$numeric = Currency::parse($input);
$model->amount = $numeric; // Store: 150000
```

---

### 4. **Use Appropriate Format for Context**

[](#4-use-appropriate-format-for-context)

Choose format based on where it's displayed:

```
// Dashboards: Shorthand
echo Currency::toShorthand($revenue);

// Reports: Full format
echo Currency::format($revenue);

// Invoices: Words
echo Currency::toIndianWords($total);

// Cards: Words format
echo Currency::toWords($amount);
```

---

### 5. **Handle Negative Amounts**

[](#5-handle-negative-amounts)

Always check for negative values:

```
$balance = -5000;

// Use accounting format for negatives
echo Currency::formatAccounting($balance);
// Output: "(₹5,000.00)"
```

---

🧪 Testing
---------

[](#-testing)

Run the test suite:

```
composer test
```

Run tests with coverage:

```
composer test:coverage
```

### Example Test Cases

[](#example-test-cases)

```
use Laxmidhar\DesiCurrency\Facades\Currency;

test('formats amount in Indian style', function () {
    expect(Currency::format(123456.78))
        ->toBe('₹1,23,456.78');
});

test('converts to lakhs notation', function () {
    expect(Currency::toWords(150000))
        ->toBe('₹1.5 Lakh');
});

test('parses shorthand notation', function () {
    expect(Currency::parse('1.5L'))
        ->toBe(150000.0);
});

test('converts to Indian words', function () {
    expect(Currency::toIndianWords(1234.50))
        ->toBe('One Thousand Two Hundred Thirty Four Rupees and Fifty Paise');
});
```

---

📊 Comparison with Other Solutions
---------------------------------

[](#-comparison-with-other-solutions)

FeatureDesi CurrencyManual FormattingOther PackagesIndian Numbering✅❌⚠️ LimitedLakh/Crore Support✅❌❌Shorthand Parsing✅❌❌Words Conversion✅❌⚠️ English onlyZero Config✅N/A❌Laravel Integration✅N/A⚠️ Limited---

🔒 Security
----------

[](#-security)

If you discover any security-related issues, please email  instead of using the issue tracker.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please follow these steps:

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

Please ensure:

- All tests pass
- Code follows PSR-12 standards
- New features include tests
- Documentation is updated

---

📝 Changelog
-----------

[](#-changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent changes.

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

---

👨‍💻 Author
----------

[](#‍-author)

**Laxmidhar Maharana**

Senior Laravel Developer • Open Source Contributor

- 🔗 [GitHub](https://github.com/dante-san)
- 💼 [LinkedIn](https://www.linkedin.com/in/laxmidharmaharana/)
- ✉️ [Email](mailto:papu.team7@gmail.com)

---

⭐ Show Your Support
-------------------

[](#-show-your-support)

If this package helped you, please give it a ⭐️ on [GitHub](https://github.com/dante-san/desi-currency)!

---

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

Special thanks to:

- The Laravel community for inspiration
- Indian developers who understand the pain of currency formatting

---

📚 Related Packages
------------------

[](#-related-packages)

- [Laravel Helpers](https://github.com/dante-san/laravel-helpers) - 85+ Helper Functions
- [Laravel Money](https://github.com/cknow/laravel-money) - Money handling
- [Laravel Cashier](https://laravel.com/docs/billing) - Subscription billing

---

🗺️ Roadmap
----------

[](#️-roadmap)

### ✅ Completed

[](#-completed)

- Blade directives for formatting

### 🔜 Upcoming

[](#-upcoming)

- Add support for other Indian regional formats
- Currency conversion support
- GST calculations
- Tax computation helpers
- Multi-currency support

---

❓ FAQ
-----

[](#-faq)

**Q: Can I use this for non-Indian currencies?**
A: This package is specifically designed for Indian Rupee and Indian numbering system. For other currencies, consider using Laravel Money or similar packages.

**Q: Does it handle GST calculations?**
A: Not yet, but it's on the roadmap. Current version focuses on formatting and conversion.

**Q: Can I customize the decimal places?**
A: Yes, methods like `toLakhs()` and `toCrores()` accept a `$decimals` parameter.

**Q: Does it work with Blade templates?**
A: Yes! You can use the `Currency` facade directly in Blade templates as shown in the examples above.

**Q: How do I handle very large amounts (Thousands of Crores)?**
A: The package handles amounts up to PHP's float limit. For extremely large numbers, consider using BC Math functions.

---

Made with ❤️ for Indian Developers

 **Supporting Digital India • Made in India 🇮🇳**

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance61

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

4

Last Release

246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15bc98971a080abec441d7011caba11bdebd31efcf730038ce3da7a05c21438f?d=identicon)[dante-san](/maintainers/dante-san)

---

Top Contributors

[![dante-san](https://avatars.githubusercontent.com/u/24512266?v=4)](https://github.com/dante-san "dante-san (9 commits)")

---

Tags

laravelcurrencyhelpersmoney\_formatpaisatankaindian-paisaindian-currencyindian-currency-formatdesi-currencydesi-money-formatrupeelakhcrore

### Embed Badge

![Health badge](/badges/laxmidhar-desi-currency/health.svg)

```
[![Health](https://phpackages.com/badges/laxmidhar-desi-currency/health.svg)](https://phpackages.com/packages/laxmidhar-desi-currency)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
