I am displaying total amount after GSt apply. When total amount is 1497,after applying 18% gst i am getting 1766.46 amount. it is correct or we can round this amount as 1766 if yes,the how can i round this value in blade file as well as jquery.
<div class="mt-2">
<span>
<label><b>Total Amount</b></label>
</span>
<?php $total_buynow_amount=$getBuynowProduct->subtotal+($getBuynowProduct->subtotal*0.18)?>
<span class="price-right buynow_total_price">
{{number_format( $total_buynow_amount, 2) }}
</span>
</div>
jquery:
$('.buynow_qtyplus').click(function() {
var buynow_id=$(this).attr('data-id');
var product_id=$(this).attr('data-value');
var qty=$(this).prev().text();
var input=$(this).prev();
var subtotal=$(this).parent().parent().parent().next().find("span.buynow_subtotal").text();
var input_subtotal=$(this).parent().parent().parent().next().find("span.buynow_subtotal");
var sub_total=$(this).parent().parent().parent().parent().parent().parent().parent().next().find("span.buynow_final_sub_total_price").text();
var buynow_final_sub_total_price=$(this).parent().parent().parent().parent().parent().parent().parent().next().find("span.buynow_final_sub_total_price");
var total=$(this).parent().parent().parent().parent().parent().parent().parent().next().find("span.buynow_total_price").text();
var buynow_total_price=$(this).parent().parent().parent().parent().parent().parent().parent().next().find("span.buynow_total_price");
jQuery.ajax({
url: "{{ url('/buynow_qty_increment') }}",
method: 'get',
data: {
qty: qty,id:buynow_id,product_id:product_id
},
success: function(result){
if(result.status==1)
{
input.text(result.qty);
input_subtotal.text(result.subtotal);
buynow_final_sub_total_price.text(result.subtotal);
buynow_total_price.text(result.subtotal+(result.subtotal*0.18));
$(".modal-content").html("<div><i class='fa fa-check-circle'></i><span style='margin-left:5px;'>" + result.message + "</span></div>");
$(".modal").modal("show");
setTimeout(function() {
$('.modal').modal('hide');
}, 3000);
}
else
{
input.text(result.qty);
input_subtotal.text(result.subtotal);
buynow_final_sub_total_price.text(result.subtotal);
buynow_total_price.text(result.subtotal+(result.subtotal*0.18));
}
}});
});