sl-currency-formatter
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

sl-currency-formatter

A simple and flexible currency Javascript formatter for the Srilankan Rupee

Installation

You can install the package via npm:

npm install sl-currency-formatter

Usage

import { formatSLR } from "sl-currency-formatter";

or

const { formatSLR } = require("sl-currency-formatter");
console.log(formatSLR(123344));
console.log(formatSLR("4555.50", { lang: "tamil" }));

Parameters

  • options (object):
    • commas (boolean,default=true): determines whether the output is comma seperated.
    • cents (boolean,default=true): display the cents.
    • lang ("english"|"sinhala"|"tamil"): language for prefix (default: 'en-US').
    • prefix (boolean,default=true): include prefix.
    • prefixCode (string,default="Rs."): prefix string.
    • suffixCode (string,default=" /="): suffix string

Package Sidebar

Install

npm i sl-currency-formatter

Weekly Downloads

22

Version

1.0.2

License

ISC

Unpacked Size

22 kB

Total Files

10

Last publish

Collaborators

  • aslamjm