INR formatting
Indian lakh-style grouping with configurable decimals and optional ₹ symbol.
A lightweight, TypeScript-first library for formatting, GST, discounts, fees, commissions, and order totals — built for e-commerce, booking, and payment workflows.
11
Exported functions
0
Runtime dependencies
100%
TypeScript typed
Features
From display formatting to full checkout totals — one small package, no runtime dependencies.
Indian lakh-style grouping with configurable decimals and optional ₹ symbol.
Convert between rupees and paise for payment gateways and ledger storage.
Add or remove GST with CGST/SGST split for intra-state or IGST for inter-state.
Percentage and fixed-amount discounts with original, saved, and final amounts.
Platform fees and marketplace commissions with net payout breakdowns.
Cart subtotal, discount, fees, tax, and grand total in one call.
Install
npm install moneyutils-inimport {
formatINR,
addGST,
calculatePercentageDiscount,
calculateCommission,
} from "moneyutils-in";
formatINR(125000);
// ₹1,25,000.00
addGST(1000, 18);
// { taxableAmount: 1000, totalTax: 180, totalAmount: 1180, ... }
calculatePercentageDiscount(2000, 15);
// { originalAmount: 2000, discountAmount: 300, finalAmount: 1700, ... }
calculateCommission(5000, 12);
// { commissionAmount: 600, netAmount: 4400, ... }import { calculateOrderTotal } from "moneyutils-in";
const total = calculateOrderTotal({
items: [
{ price: 999, quantity: 2 },
{ price: 2499, quantity: 1 },
],
discount: { type: "percentage", value: 10 },
fees: [{ name: "Delivery", amount: 50 }],
tax: { rate: 18 },
});
console.log(total.grandTotal);
// 4834.81Disclaimer: GST and tax utilities perform calculations based on the values provided by the developer. They do not determine the legally applicable tax rate or tax treatment for a transaction.
Browse the full API reference or try every function in the live playground.