1.0.2 • Published 4 months ago

sl-currency-formatter v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

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
1.0.2

4 months ago

1.0.1

5 months ago

1.0.0

5 months ago