Coder Social home page Coder Social logo

angka-terbilang-nodejs's Introduction

NodeJS package for Converting Decimal to an Indonesian Wording format

This package will help you to convert a decimal to an Indonesian wording format, for example 123 will be converted to seratus dua puluh tiga. This package was inspired from develoka/angka-terbilang-js by Develoka Team.

Getting Started

These instructions will get you this package can be used in your project.

Prerequisites

Prequisites Packages:

  • NodeJS (NodeJS Programming Language)

Using This Package

Below is the instructions to use this package:

  • Install this package to your project
npm install --save @dimaskiddo/angka-terbilang-nodejs
  • Import this package to your code
...
const angka = require('@dimaskiddo/angka-terbilang-nodejs')
...
  • Use ToTerbilang function to convert your decimal string
...
console.log(angka.toTerbilang('123'))
...

Example Usage of Package

Below is the simple example source code:

const angka = require('@dimaskiddo/angka-terbilang-nodejs')
console.log(angka.toTerbilang('123'))

Example Usage for in Browser Javascript

Below is the example of using for in Browser Javascript:

<script src="https://unpkg.com/@dimaskiddo/angka-terbilang-nodejs@latest/index.min.js"></script>
console.log(angka.toTerbilang('123'))

Development

Editing

  • Clone this repository in to your local computer
git clone -b master https://github.com/dimaskiddo/angka-terbilang-nodejs.git
  • Edit index.js file in the root of cloned repository directory

Running The Tests

To run the test you can run the following command

npm run test

Rebuilding

After editing you also need to rebuild the minified and browser javascript version by running the following command

npm run minified

Or you can run the full build with the test with following command

npm run build

Benchmarking

Benchmark is done with four (4) other packages that has the same function. It's done by converting a decimal number with units hundreds of thousands, hundreds of millions, hundreds of billions, hundreds of trillions.

Benchmark tools are provided by Develoka Team

Benchmark Results

Benchmark with NodeJS 10.18.0 @ November 8th 2020 14:55

Package Angka Ratusan Ribu Angka Ratusan Juta Angka Ratusan Milyar Angka Ratusan Triliun
@dimaskiddo/angka-terbilang-nodejs 2,836,662 ops/sec 2,029,144 ops/sec 1,386,470 ops/sec 1,095,911 ops/sec
@develoka/angka-terbilang-js 2,385,251 ops/sec 1,832,777 ops/sec 1,371,450 ops/sec 1,085,423 ops/sec
dikyarga/angka-menjadi-terbilang 113,920 ops/sec 97,849 ops/sec 85,656 ops/sec 75,029 ops/sec
BosNaufal/terbilang-js 194,925 ops/sec 133,416 ops/sec 76,289 ops/sec 47,955 ops/sec
rimara14/terbilang 532,279 ops/sec 312,694 ops/sec 188,072 ops/sec 2,504,031 ops/sec

Benchmark Device

Operating System: MacOS High Sierra 10.13.6
CPU Model: Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
CPU Core: 2 Core with Hypterthreading (4 vCPU)
RAM: 8 GB
Disk Type: SSD

Benchmark Notes

The result might be different depending on the undelying software or hardware that used to run benchmark

Built With

  • NodeJS - NodeJS Programming Languange

Authors

  • Dimas Restu Hidayanto - Initial Work - DimasKiddo
  • R. M. Dwi Rizki - Fungsional Test and Benchmarking - rmdwirizki

See also the list of contributors who participated in this project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.