Two directions, one idea — GST is always a percentage of the base price:
Exclusive: GST = Price × Rate ÷ 100 · Total = Price + GST
Inclusive: GST = Price × Rate ÷ (100 + Rate) · Base = Price − GST
The inclusive formula works because the GST-inclusive price equals base × (1 + rate ÷ 100); solving for the tax component gives rate ÷ (100 + rate) of the total.