PHPackages                             febripratama/terbilang - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. febripratama/terbilang

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

febripratama/terbilang
======================

Hasil fork dari https://github.com/riskihajar/terbilang

1.1(3y ago)010MITPHPPHP &gt;=5.4.0

Since Aug 30Pushed 3y agoCompare

[ Source](https://github.com/FebriPratama/terbilang)[ Packagist](https://packagist.org/packages/febripratama/terbilang)[ Docs](https://github.com/riskihajar/terbilang)[ RSS](/packages/febripratama-terbilang/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Number To Words Conversion For Laravel
--------------------------------------

[](#number-to-words-conversion-for-laravel)

[![Build Status](https://camo.githubusercontent.com/daad94c6f7e235c9b9cffc1c33259625f22ac7576166468f8cb69869825cafb9/68747470733a2f2f7472617669732d63692e6f72672f7269736b6968616a61722f74657262696c616e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/riskihajar/terbilang)[![Latest Stable Version](https://camo.githubusercontent.com/b41f4fd46c03d2aa59986c0e80f21b992ab717888adbdd2737fded208b3e5520/68747470733a2f2f706f7365722e707567782e6f72672f7269736b6968616a61722f74657262696c616e672f762f737461626c652e737667)](https://packagist.org/packages/riskihajar/terbilang)[![Total Downloads](https://camo.githubusercontent.com/f57cab6372f7b2efcb43527de37e9bdeba841a9e0d2cc14c98bd68c9d8901898/68747470733a2f2f706f7365722e707567782e6f72672f7269736b6968616a61722f74657262696c616e672f646f776e6c6f6164732e737667)](https://packagist.org/packages/riskihajar/terbilang)[![Latest Unstable Version](https://camo.githubusercontent.com/e46ae4ade94caa4a9d2039f7c63fc3686fa756ac82685ef6e4cbc1d2f21965a3/68747470733a2f2f706f7365722e707567782e6f72672f7269736b6968616a61722f74657262696c616e672f762f756e737461626c652e737667)](https://packagist.org/packages/riskihajar/terbilang)[![License](https://camo.githubusercontent.com/17ca78c9a9d10e553789a406298ce24926d54024d830415a264443985f4a920d/68747470733a2f2f706f7365722e707567782e6f72672f7269736b6968616a61722f74657262696c616e672f6c6963656e73652e737667)](https://github.com/riskihajar/terbilang/blob/master/LICENSE)

Number to words conversion support multi language.

### Supported Language

[](#supported-language)

- `id` | Bahasa Indonesia
- `en` | English
- `pt` | Portuguese
- soon

### Feature

[](#feature)

- [Number to Word](https://github.com/riskihajar/terbilang#number-to-words)
- [Number to Roman](https://github.com/riskihajar/terbilang#number-to-roman)
- [Number Short Hand](https://github.com/riskihajar/terbilang#number-short-hand)
- [Datetime to Word](https://github.com/riskihajar/terbilang#datetime)
- [Period](https://github.com/riskihajar/terbilang#period)

### Usage

[](#usage)

#### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
composer require febripratama/terbilang

```

then run `composer update`

For Laravel 4 Please use `1.0.4` version

#### Step 2: Add Providers &amp; Aliases

[](#step-2-add-providers--aliases)

In the `$providers` array add the service providers for this package.

```
Riskihajar\Terbilang\TerbilangServiceProvider::class,

```

Add the facade of this package to the `$aliases` array.

```
'Terbilang' => Riskihajar\Terbilang\Facades\Terbilang::class,

```

#### Step 3: Publish Configuration (Optional)

[](#step-3-publish-configuration-optional)

If you want customize configuration, you can run following command to publish config file

```
php artisan vendor:publish --provider="Riskihajar\Terbilang\TerbilangServiceProvider"

```

### Examples

[](#examples)

#### Number To Words

[](#number-to-words)

`Terbilang::make($number, $suffix, $prefix)`

if you set locale to en

```
Terbilang::make(1000000); // one million

```

if you set locale to id

```
Terbilang::make(1000000); // satu juta

```

##### Prefix &amp; Suffix

[](#prefix--suffix)

if you set locale to id

```
Terbilang::make(123456, ' rupiah', 'senilai ');
// senilai seratus dua puluh tiga ribu, empat ratus lima puluh enam rupiah

```

if you set locale to en

```
Terbilang::make(654321, ' dollars');
// six hundred and fifty-four thousand, three hundred and twenty-one dollars

```

#### Number to Roman

[](#number-to-roman)

`Terbilang::roman($number, $lowercase=false)`

```
Terbilang::roman(1234); //MCCXXXIV

```

#### Number Short Hand

[](#number-short-hand)

`Terbilang::short($number, $format)`

Available short hand : `kilo, million, billion, trillion`

Default value : `million`

if you set locale to en

```
Terbilang::short(1000000); // 1M

```

if you set locale to id

```
Terbilang::short(1000000); // 1jt

```

#### Datetime

[](#datetime)

##### Date `Terbilang::date($date, $format='Y-m-d');`

[](#date-terbilangdatedate-formaty-m-d)

```
$date = date('Y-m-d'); // 2015-03-31
Terbilang::date($date);
// Result : tiga puluh satu maret dua ribu lima belas

```

##### Time `Terbilang::time($date, $format='h:i:s');`

[](#time-terbilangtimedate-formathis)

```
$date = date('h:i:s'); //10:56:30
Terbilang::time($date);
// Result : sepuluh lewat lima puluh enam menit tiga puluh tiga detik

```

##### Date Time `Terbilang::datetime($date, $format='Y-m-d h:i:s');`

[](#date-time-terbilangdatetimedate-formaty-m-d-his)

```
$date = date('Y-m-d h:i:s'); // 2015-03-31 10:58:27
Terbilang::datetime($date);
// Result : tiga puluh satu maret dua ribu lima belas pukul sepuluh lewat lima puluh delapan menit dua puluh tujuh detik

```

##### Using Carbon

[](#using-carbon)

if using carbon, you can ignore `$format`

```
$dt = Carbon\Carbon::now('Asia/Makassar');

$date = Terbilang::date($dt);
$time = Terbilang::time($dt);
$datetime = Terbilang::datetime($dt);

```

#### Period

[](#period)

You can diff two dates or just one date and automaticly with current date use method `Terbilang::period($start, $end=null, $format=null)`

##### Config for period format

[](#config-for-period-format)

```
'period' => [
     'type' => 'FULL',
     'format' => '{YEAR} {MONTH} {DAY} {HOUR} {MINUTE} {SECOND}',
     'hide_zero_value' => true,
     'separator' => ' ',
     'terbilang' => false,
     'show' => [
         'year' => true,
         'month' => true,
         'day' => true,
         'hour' => true,
         'minute' => true,
         'second' => true,
     ]
 ],

```

##### Example Period

[](#example-period)

```
$date1 = date('Y-m-d', strtotime('2017-05-01')); // dateformat must Y-m-d H:i:s
$date2 = date('Y-m-d', strtotime('2017-06-15 09:30:15'));

// this method will diff $date1 with current datetime value for example current datetime : 2017-09-08 15:17:54
Terbilang::period($date1); // Result : 4 months 8 days 15 hours 17 minutes 54 seconds

Terbilang::period($date1, $date2); // Result : 1 months 15 days 9 hours 30 minutes 15 seconds

// if you set locale to id
Terbilang::period($date1, $date2); // Result : 1 bulan 15 hari 9 jam 30 menit 15 detik

// if you set config period.terbilang to true
Terbilang::period($date1, $date2); // Result : satu bulan lima belas hari sembilan jam tiga puluh menit lima belas detik

// if you set config period.type to DAY
Terbilang::period($date1, $date2); // Result : 45 hari

```

License
-------

[](#license)

Riskihajar Terbilang is licensed under the [MIT License](http://opensource.org/licenses/MIT).

Copyright 2017 [riskihajar](http://riskihajar.com/)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40218a91f9c600d25faae80c176162da9ce341563be61ef7c004bc0f98177a2f?d=identicon)[febripratama](/maintainers/febripratama)

---

Top Contributors

[![riskihajar](https://avatars.githubusercontent.com/u/6370157?v=4)](https://github.com/riskihajar "riskihajar (63 commits)")[![FebriPratama](https://avatars.githubusercontent.com/u/7270604?v=4)](https://github.com/FebriPratama "FebriPratama (12 commits)")[![nafiesl](https://avatars.githubusercontent.com/u/8721551?v=4)](https://github.com/nafiesl "nafiesl (12 commits)")[![ricardobarantini](https://avatars.githubusercontent.com/u/1111361?v=4)](https://github.com/ricardobarantini "ricardobarantini (1 commits)")

---

Tags

laravelterbilangnumber to wordsdate to wordsnumber to roman

### Embed Badge

![Health badge](/badges/febripratama-terbilang/health.svg)

```
[![Health](https://phpackages.com/badges/febripratama-terbilang/health.svg)](https://phpackages.com/packages/febripratama-terbilang)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[riskihajar/terbilang

Number to words conversion support multi language.

135178.6k](/packages/riskihajar-terbilang)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
