Step 1 :The problem states that the sales tax $y$ is directly proportional to the retail price $x$. This means that the relationship between $y$ and $x$ can be expressed as $y = kx$, where $k$ is the constant of proportionality.
Step 2 :We can find the value of $k$ by substituting the given values of $y$ and $x$ into the equation. Given that an item that sells for 186 dollars has a sales tax of 10.22 dollars, we substitute these values into the equation to get $10.22 = k \times 186$.
Step 3 :Solving for $k$, we get $k = \frac{10.22}{186} = 0.054946236559139786$.
Step 4 :Now that we have the value of $k$, we can use it to find the sales tax on a 340 dollars purchase. Substituting $x = 340$ into the equation $y = kx$, we get $y = 0.054946236559139786 \times 340 = 18.68172043010753$.
Step 5 :Rounding to the nearest cent, the sales tax on a 340 dollars purchase is \(\boxed{18.68}\) dollars.