Skip to content

Simple and lightweight rupiah currency format written in typescript

Notifications You must be signed in to change notification settings

andriawan/rupiah_ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Simple and lightweight rupiah currency format written in typescript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published