â ī¸ Warning â ī¸ Deprecated Code! This video tutorial contains outdated code.
đĄ If you wish to update it, any AI assistant will update the code for you in seconds.
đĄ If you wish to update it, any AI assistant will update the code for you in seconds.
JavaScript How to Calculate Tax Rates into Prices
Learn to calculate tax rates into prices using JavaScript.
<script>
let gstRate = 5;
let pstRate = 10;
let roomprice = 100;
let totalwithgst = roomprice * (1 + gstRate / 100);
let totalwithpst = roomprice * (1 + pstRate / 100);
let totalfixedgst = totalwithgst.toFixed(2);
let totalfixedpst = totalwithpst.toFixed(2);
alert( totalwithgst + " | " + totalwithpst );
alert( totalfixedgst + " | " + totalfixedpst );
</script>