Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 1.76 KB

README.md

File metadata and controls

64 lines (50 loc) · 1.76 KB

Rupiah

Indonesian Currency (format number to indonesian currency) based on Standart PUEBI format

Installation in Deno

import Rupiah from 'https://deno.land/x/rupiah_ts/rupiah.ts'

let rupiah = new Rupiah(350000);
console.log(rupiah.format);
// result Rp350.000,00

Terbilang

You can also make number to terbilang (words version of rupiah)

import Rupiah from 'https://deno.land/x/rupiah_ts/rupiah.ts'

let rupiah = new Rupiah(350000);
console.log(rupiah.terbilang);
// result Tiga Ratus Lima Puluh Ribu Rupiah

Set Prefix and Suffix

Default prefix is configured as Rp and suffix is configured as ,00 you can set custom prefix and suffix with this following API

import Rupiah from 'https://deno.land/x/rupiah/rupiah.ts'

let rupiah = new Rupiah(350000);
rupiah.setPrefix = "RP";
rupiah.setSuffix = ",-";
console.log(rupiah.format);
// result Rp350.000,-

Separator

Default separator is configured as . you can set custom separator with this following API

import Rupiah from 'https://deno.land/x/rupiah/rupiah.ts'

let rupiah = new Rupiah(350000);
rupiah.setSeparator = "-";
console.log(rupiah.format);
// result 350-000

Development

This repo is in early development stage. PRs is welcomed.

Test

Just run from cli

deno test

Feature Roadmap

  • Rupiah Format
  • Terbilang

Miscellaneous