I'm trying to calculate the tax payable on sales, and want to reduce the amount of decimal places in the answer.
I'm using doubles for the cost price, sale price and tax calculation, but it's being too accurate - I want an answer like £10.27, but instead I'm getting 10.4354356437896 or something similar.
Is there an easy way to cut this down when I set it in a text field as a String, or should I be using floats for the calculation?
Thanks![]()


Reply With Quote


Bookmarks