npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@develoka/angka-terbilang-js

v1.4.2

Published

Mengkonversi angka ke dalam bilangan bahasa Indonesia

Downloads

11,715

Readme

Angka-terbilang-js NPM Version Minified Size

Mengkonversi angka ke dalam bilangan bahasa Indonesia. Misalnya dari 123, menjadi seratus dua puluh tiga.

Demo

Link Demo

Instalasi

npm install @develoka/angka-terbilang-js

kemudian

import angkaTerbilang from '@develoka/angka-terbilang-js'; // if using import
const angkaTerbilang = require('@develoka/angka-terbilang-js'); // if using require

atau langsung dari web browser

<script src="https://unpkg.com/@develoka/angka-terbilang-js/index.min.js">

Penggunaan

console.log(angkaTerbilang(777666555));
// tujuh ratus tujuh puluh tujuh juta enam ratus enam puluh enam ribu lima ratus lima puluh lima
console.log(angkaTerbilang('1002109381290'));
// satu triliun dua milyar seratus sembilan juta tiga ratus delapan puluh satu ribu dua ratus sembilan puluh
console.log(angkaTerbilang('3148112838011192391239213'));
// tiga septiliun seratus empat puluh delapan sextiliun seratus dua belas quintiliun delapan ratus tiga puluh delapan quadriliun sebelas triliun seratus sembilan puluh dua milyar tiga ratus sembilan puluh satu juta dua ratus tiga puluh sembilan ribu dua ratus tiga belas

Fitur

A. Mendukung konversi angka di belakang koma

Default simbol koma adalah ".". Untuk mengubah gunakan parameter { decimal: ','}.

console.log(angkaTerbilang(123.23));
// seratus dua puluh tiga koma dua tiga
console.log(angkaTerbilang('123.23'));
// seratus dua puluh tiga koma dua tiga
console.log(angkaTerbilang('123,23', {decimal: ','}));
// seratus dua puluh tiga koma dua tiga

B. Mendukung bilangan besar, hingga 1063.

| Angka | Satuan | |:---------------:|:----------------:| | 101 | puluhan | | 102 | ratusan | | 103 | ribu | | 106 | juta | | 109 | milyar | | 1012 | triliun | | 1015 | quadriliun | | 1018 | quintiliun | | 1021 | sextiliun | | 1024 | septiliun | | 1027 | oktiliun | | 1030 | noniliun | | 1033 | desiliun | | 1036 | undesiliun | | 1039 | duodesiliun | | 1042 | tredesiliun | | 1045 | quattuordesiliun | | 1048 | quindesiliun | | 1051 | sexdesiliun | | 1054 | septendesiliun | | 1057 | oktodesiliun | | 1060 | novemdesiliun | | 1063 | vigintiliun |

Testing

Testing menggunakan jest. Lihat file tests.

npm install
npm run test

Development

Edit index.js kemudian jalankan perintah:

npm run build

Benchmark / Uji Performa

Benchmark dilakukan terhadap 2 package serupa lainnya. Dengan mengkonversi angka dengan besaran ratusan ribu, ratusan juta, ratusan milyar, ratusan triliun.

| Package | Angka Ratusan Ribu | Angka Ratusan Juta | Angka Ratusan Milyar | Angka Ratusan Triliun | |----------------------------------|-------------------|-------------------|-------------------|-------------------| | @develoka/angka-terbilang-js | 3,033,891 ops/sec | 2,304,711 ops/sec | 1,748,600 ops/sec | 1,339,721 ops/sec | | dikyarga/angka-menjadi-terbilang | 116,710 ops/sec | 103,075 ops/sec | 85,881 ops/sec | 77,056 ops/sec | | BosNaufal/terbilang-js | 188,457 ops/sec | 130,263 ops/sec | 80,033 ops/sec | 54,130 ops/sec | | DimasKiddo/angka-terbilang-nodejs | 1,843,987 ops/sec | 1,791,951 ops/sec | 1,327,440 ops/sec | 1,050,543 ops/sec | | rimara14/terbilang | 423,788 ops/sec | 291,578 ops/sec | 170,460 ops/sec | 1,103,812 ops/sec |

Detail benchmark dapat dilihat pada halaman repository benchmark.