Skip to content

irhammusthofa/Currency-ID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Currency-ID

Merubah format double ke Format Currency ID yaitu format mata Uang Rupiah, seperti : 10000 -> Rp10,000

Import Lib :

import java.util.Locale;
import java.text.NumberFormat;

Fungsi CurrencyID :

public static String currencyID(double nominal){
    Locale localeID = new Locale("in", "ID");
    NumberFormat formatRupiah = NumberFormat.getCurrencyInstance(localeID);
    return formatRupiah.format((double)nominal);
}

Contoh penggunaan :

double nominal = 10000;
String output = currencyID(nominal);
Log.i("outputCurrency",output);

untuk melihat tutorial lainnya bisa kunjungi blog saya https://blog.kamil.co.id

Releases

No releases published

Packages

No packages published