|
|
|
@ -208,11 +208,37 @@ function updateActivity(id)
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Fungsi format ribuan label*/ |
|
|
|
|
function formatRupiah(n) {
|
|
|
|
|
var parts=n.toString().split("."); |
|
|
|
|
return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".") + (parts[1] ? "," + parts[1] : ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Fungsi format ribuan inputan*/ |
|
|
|
|
function formatRibuanInput(angka, prefix) |
|
|
|
|
{ |
|
|
|
|
var number_string = angka.replace(/[^,\d]/g, '').toString(), |
|
|
|
|
split = number_string.split(','), |
|
|
|
|
sisa = split[0].length % 3, |
|
|
|
|
rupiah = split[0].substr(0, sisa), |
|
|
|
|
ribuan = split[0].substr(sisa).match(/\d{3}/gi); |
|
|
|
|
|
|
|
|
|
if (ribuan) { |
|
|
|
|
separator = sisa ? '.' : ''; |
|
|
|
|
rupiah += separator + ribuan.join('.'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah; |
|
|
|
|
return prefix == undefined ? rupiah : (rupiah ? 'Rp. ' + rupiah : ''); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Fungsi replace titik, untuk save ke DB*/ |
|
|
|
|
function formatReplaceTitikRibuan(param){ |
|
|
|
|
let myStr = param; |
|
|
|
|
let newStr = myStr.replace('.', ''); |
|
|
|
|
return newStr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function formatDate(params){ |
|
|
|
|
let today = new Date(params); |
|
|
|
|
let yyyy = today.getFullYear(); |
|
|
|
|