Hi Sam,
Your solution with the Color Ramp should work as well, but have given a slightly smoother cutoff….you just should have switched the A and B Inputs of the Mix Color then. Or Flip the B&W Color Ramp.
Personally, I always like using Math Nodes, because they are so predictable (to me).