Created
March 12, 2019 06:38
-
-
Save manjeshpv/258c8826614d84da650dc7daf9f09b9a to your computer and use it in GitHub Desktop.
GST Calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const total_amount = 379; | |
const base_amount = total_amount / 1.12; | |
console.log('base_amount', base_amount); | |
const percentage = 6; | |
const factor = percentage/100; | |
console.log('factor', factor); | |
const sgst = Math.ceil(base_amount*factor*100)/100; | |
const cgst = sgst; | |
console.log(cgst); | |
const igst = cgst + sgst; | |
console.log('actual_base', total_amount - igst); | |
const actual_base = total_amount - igst; | |
const total_amount_before_gst = total_amount - igst; | |
console.log('total_amount_before_gst', total_amount_before_gst); | |
const alt_total_amount = actual_base + igst; | |
console.log('alt_total_amount', alt_total_amount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment