title: How to save a decimal number to mysql database without knowing the exact amount of digits after the decimal
body: <p>I have a MySQL database that I need to save decimal numbers in. I normally just use the decimal type, but I am saving currency pair values that can be 2, 3, 4 or 5 digits after the decimal. My temporary fix is to use a Varchar or set the decimal length to 5 and work with some extra zeros on smaller decimals, but this is not optimal for calculations. How can I store a decimal number with different amounts of digits</p>