https://forrest-wilson.github.io/gstjs/
<script src="js/gst.min.js"></script>
// decimalPercent should be written as a decimal
// e.g. a 25% GST rate should be defined as 0.25
// Only decimalPercent's smaller than 1 will be accepted
var gst = new GST(decimalPercent);
Returns the GST inclusive number.
gst.getTotal(subtotal)
typeof subtotal ? number : string
Returns the GST exclusive number.
gst.getSubtotal(total)
typeof total ? number : string
Returns the GST component of a transaction.
gst.getGST(total, subtotal)
typeof total && typeof subtotal ? number : string
Returns the GST percentage of a transaction.
gst.getPercent(total, subtotal)
typeof total && typeof subtotal ? number : string
Returns a formatted string with the currency sign of choice. Default return value is "$0.00".
gst.formatter(total, currencySign)
typeof total ? number : string
typeof currencySign = string