standdard financil formula for calculating of taxes is:
Price exl. tax *(1+tax/100)=Price incl. tax
Price incl. tax /(1+tax/100)= Price exl. tax ,
tax = %tax, as example let suppose that tax = 20%
$100 * (1 +20/100)=$120
$120 / (1 +20/100)=$100
of cource do not forget rounding some times it creates a lot of problems if you look for mark up a few times.
Price incl. tax /(1+(GST+PST)/100)= Price exl. tax