GST.JS

A Simple Vanilla Javascript Plugin for calculating GST.

View on Github

Basic Usage

HTML

                    
                        <script src="gst.min.js"></script>
                    
                

JS

                    
                        var gst = new GST();
                    
                

Methods

.getTotal(subtotal)

                    
                        gst.getTotal(50);
                    
                

.getSubtotal(total)

                    
                        gst.getSubtotal(50);
                    
                

.getGST(total, subtotal)

                    
                        gst.getGST(50, 42.5);
                    
                

.getPercent(total, subtotal)

                    
                        gst.getPercent(50, 42.5);
                    
                

.formatter(total, currencySign)

                    
                        gst.formatter(50, "$");
                    
                

Demo

GST.getTotal()

GST.getSubtotal()

GST.getGST()

GST.getPercent()

GST.formatter()