Code Monkey home page Code Monkey logo

manusier's Introduction

Manusier

A utility library for messing with number, string, and datetime solely in Indonesian locale.

See the specification of this library to learn more.

If you came here because of Hacktoberfest, you may try to port the library into other languages. Currently active languages that being developed are Javascript, Go, and C#. You may add your own language ๐Ÿ˜‰

manusier's People

Stargazers

 avatar

Forkers

andriyandriyan

manusier's Issues

[RFC] Project Specification

This issue is meant to be the discussion for the project specification. Put a issue comment if you have any idea of what to implement.

Numbers

FormatRupiah(int n, int limit)

Formats a given integer to a locally formatted Rupiah string. Might also have a limit argument, so instead of Rp1.000.000,00, it would print out Rp1M or Rp1mio.

Sample input -> output:

  • FormatRupiah(1_000_000) -> Rp1.000.000,00
  • FormatRupiah(-1_000_000) -> (Rp1.000.000)

Implementation done on:

  • Javascript
  • Go
  • C#
  • Kotlin
  • Ruby

Terbilang(int n)

Converts a given integer to words

Sample input -> output

  • Terbilang(123_456) -> seratus dua puluh tiga ribu empat ratus lima puluh enam
  • Terbilang(-123_456) -> minus seratus dua puluh tiga ribu empat ratus lima puluh enam
  • Terbilang(0) -> nol

Implementation done on:

  • Javascript
  • Go
  • C#
  • Kotlin
  • Ruby

Diskon(int nominal, UnitDiskon unit, int amount, int x, int y, int z)

Add a discount to the given integer with the specified amount and unit and returns an integer. Where UnitDiskon is an enum of MinPurchaseOfX, PercentOfX, MinXMaxY.

Sample input -> output

  • Diskon(50_000, UnitDiskon.PercentOfX, 10) -> 45000
  • Diskon(50_000, UnitDiskon.MinimumPembelianX, 10_000, 3, 5) -> 40000
  • Diskon(50_000, UnitDiskon.MinXMaxY, 10_000, 5, 90, 6) -> 40000

Implementation done on:

  • Javascript
  • Go
  • C#
  • Kotlin
  • Ruby

Date Time

DurasiSejak(date d)

Returns a string in which says "2 hari yang lalu", "2 jam lalu". Might even have a limit argument like FormatRupiah(), so it would print out "2j lalu" instead of "2 jam lalu".

Implementation done on:

  • Javascript
  • Go
  • C#
  • Kotlin
  • Ruby

DurasiMenuju(date d)

Like DurasiSejak() but returns the reverse of that: "2 hari kedepan", "2 jam kedepan".

Implementation done on:

  • Javascript
  • Go
  • C#
  • Kotlin
  • Ruby

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.