Limmiting a number to a certian number of decimal places

Ok for a currency i have

gold.silver which is the same as say 1.35g with ‘g’ being gold

When I calculate with tax it often goes to 10 decimal places. How do I limmit the amount of decimal places that it can access?