yaterbilang

Crates.ioyaterbilang
lib.rsyaterbilang
version0.1.6
sourcesrc
created_at2023-01-05 06:16:07.880028
updated_at2023-02-10 07:32:14.339748
descriptionYet another terbilang
homepage
repositoryhttps://github.com/rahmatnazali/yaterbilang
max_upload_size
id751349
size32,605
Rahmat Nazali Salimi (rahmatnazali)

documentation

README

Yet another terbilang 🤷

Converts u64 number to said Indonesian.

use yaterbilang as terbilang;

assert_eq!(terbilang::from(0), "nol");
assert_eq!(terbilang::from(11), "sebelas");
assert_eq!(terbilang::from(32), "tiga puluh dua");
assert_eq!(terbilang::from(998), "sembilan ratus sembilan puluh delapan");

This is just a brute force way to exhaustively determine all the possible outcome. Given that the possible input is finite and deterministic, we think that this one should not differ much in terms of performance-wise when compared to other "smarter" solution. It just works.

The source code should also be relatively dead simple and verbose to ease any future changes.

Install

Simply do cargo add yaterbilang. For more instruction, please refer to the official crate page.

Notes

  • Version 0.1.5 supports up to 999.999.999.999 (triliun).
Commit count: 51

cargo fmt