Detri Amelia Chandra
  • HOME
  • GIS
  • HTML
  • Bootstrap
  • CSS
  • Javascript
  • Ubuntu
  • Useful Tools
    • URL Redirect Tool
    • URL Download Encryptor
No Result
View All Result
Detriamelia.com
  • HOME
  • GIS
  • HTML
  • Bootstrap
  • CSS
  • Javascript
  • Ubuntu
  • Useful Tools
    • URL Redirect Tool
    • URL Download Encryptor
No Result
View All Result
Detriamelia.com
No Result
View All Result

How to Make Rupiah Format Function for Number Using PHP

02/04/2019
in PHP
Fungsi Peformatan Rupiah Pada Angka PHP

Fungsi Peformatan Rupiah Pada Angka PHP

This time let’s discuss about the Rupiah Formatting Function for numbers in PHP. Actually it’s not too difficult, because php itself already provides a special syntax to display commas in numbers, namely number_format(). If we apply it to for example the number 3000, then when it is run it will output like 3,000.

However, the result of number_format () for rupiah is still not quite right. Because the formatting of the rupiah in numbers does not use commas (,), but with a dotted (.), and of course this format is not suitable for rupiah.

For that, I have prepared rupiah function to be used easily and can be used whenever and wherever you are 😀 Please copy the following functions:

How to Make Rupiah Format Function for Number Using PHP

1
2
3
4
5
6
<?php
function rupiah($galonterbang){
$sarungberkibar = number_format($galonterbang, 0 , ',' , '.');
return $sarungberkibar;
}
?>

Meanwhile for applying, just use the function as you can see below :

1
2
3
4
5
6
7
<?php
//tanpa variable
echo rupiah(150000);
//atau menggunakan variable
int $jumlah = 150000;
echo rupiah($jumlah);
?>

It’s too easy right… just try and apply it by your self this article : How to Make Rupiah Format Function for Number Using PHP above. If you got any difficulities, don’t be shy to comment this article… Happy coding…

Tags: Currency FormatPHP
ShareTweetShare

Related Posts

PHP Forms - Validation With Required Fields
PHP

14. PHP Forms – Validation With Required Fields

Hi everyone, this time we will discuss about PHP Validation using the Required Field. Not many people know, it turns...

15/02/2020
PHP Form Handling
PHP

13. New Performing PHP Form Handling

Detriamelia.Com - Running form functions in PHP is not difficult. By using the $ _POST and $ _GET methods it...

13/02/2020
Learn PHP Global Variables - Superglobals With Example
PHP

12. Learn PHP Global Variables – Superglobals With Example

On this occasion, we will discuss Global and Superglobal Variables. These variables are some that are very important to implement....

20/01/2020
PHP Array Example, Complete Editions
PHP

11. PHP Array Example, Complete Editions

Welcome back to the PHP programming learning page. This time we will discuss arrays, more precisely arrays in PHP. Arrays...

17/01/2020
Next Post
Beautify Bootstrap Modal Animation With Animate.CSS

Beautify Bootstrap Modal Animation With Animate.CSS

Application of Jquery Mask to Numbers in HTML and PHP Forms

Application of Jquery Mask For Numbers in HTML and PHP Forms

Comments 2

  1. Pingback: Penerapan Jquery Mask Untuk Angka Pada Form HTML dan PHP - Detri Amelia Chandra
  2. JeannetteBig says:
    3 years ago

    Hi. I have checked your detriamelia.com and i see you’ve got some duplicate content so probably it is
    the reason that you don’t rank hi in google.
    But you can fix this issue fast. There is a tool that
    creates articles like human, just search in google: miftolo’s tools

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Beautify Bootstrap Modal Animation With Animate.CSS

Beautify Bootstrap Modal Animation With Animate.CSS

02/04/2019
PHP Array Example, Complete Editions

11. PHP Array Example, Complete Editions

17/01/2020
Learn PHP Global Variables - Superglobals With Example

12. Learn PHP Global Variables – Superglobals With Example

20/01/2020
What You Must Know About PHP

1. What You Must Know About PHP

10/11/2019

Instagram Feed

  • Sekolah sambil bermain...
  • Produk mahasiswa semester 5 Pendidikan Teknologi Informasi STKIP Rokania..
Kran dispenser otomatis (sensor)
#arduino
#PTI Ok
#STKIPRokania
#AyoKuliahDiRokania
  • Salah satu produk mahasiswa Pendidikan Teknologi Informasi STKIP Rokania...Pemanfaatan Internet Of Thing pada Lampu dan CCTV otomatis dengan Telegram Bot..

#StkipRokania
#PendidikanTeknologiInformasi
  • "Golden Time" yang tidak bisa diputar dan diulang tetapi tersimpan di inner child nya dan diingat selamanya..
  • Selamat atas M.Kom nya yah...semoga ada Reski untuk studi selanjutnya ya...
  • HOME
  • GIS
  • HTML
  • Bootstrap
  • CSS
  • Javascript
  • Ubuntu
  • Useful Tools
Detriamelia.Com

© 2022 Detri Amelia Chandra - IT Tips and Programming Tutorials.

No Result
View All Result
  • HOME
  • GIS
  • HTML
  • Bootstrap
  • CSS
  • Javascript
  • Ubuntu
  • Useful Tools
    • URL Redirect Tool
    • URL Download Encryptor