A simple and flexible currency Javascript formatter for the Srilankan Rupee
You can install the package via npm:
npm install sl-currency-formatter
import { formatSLR } from "sl-currency-formatter";
or
const { formatSLR } = require("sl-currency-formatter");
console.log(formatSLR(123344));
console.log(formatSLR("4555.50", { lang: "tamil" }));
-
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
-