fix rounded method two decimal places

This commit is contained in:
Hafifie PKB
2024-03-11 07:25:45 +08:00
parent 640e7291b9
commit 91177ffc0b
3 changed files with 59 additions and 21 deletions
+5 -4
View File
@@ -261,6 +261,7 @@
header("Refresh:0");
@endphp
@endif
<script src="{{ asset('js/rounded-methods.js') }}"></script>
<script>
var api_url = "<?php echo $api_url ?>";
var kodcaw_ujrah = "<?php echo $cawangan_info['kodcaw'] ?>";
@@ -491,14 +492,14 @@
}
});
var keuntungan_sebulan = array_keuntungan['keuntungan'];
var keuntungan_6bln = keuntungan_sebulan * 6;
var keuntungan_sebulan = getRoundedMethod(array_keuntungan['keuntungan']);
var keuntungan_6bln = getRoundedMethod(keuntungan_sebulan * 6);
$('.span-pinjaman').text(formatter.format(percent_pinjaman.toFixed(2)) + ' %');
$('#keuntungan_sebulan').val(formatter.format(keuntungan_sebulan.toFixed(2)));
$('#keuntungan_6bln').val(formatter.format(keuntungan_6bln.toFixed(2)));
$('#ujrah').val(formatter.format(array_keuntungan['ujrah'].toFixed(2)));
$('#onepercent').val(formatter.format(array_keuntungan['onepercent'].toFixed(2)));
$('#ujrah').val(formatter.format(getRoundedMethod(array_keuntungan['ujrah']).toFixed(2)));
$('#onepercent').val(formatter.format(getRoundedMethod(array_keuntungan['onepercent']).toFixed(2)));
});