Non-terminating decimal expansion; no exact representable decimal result
807580May 18 2010 — edited May 18 2010I am using the BigDecimal to represent an amount of money. I am doing some calculations that includes divide so I am getting an error : "Non-terminating decimal expansion; no exact representable decimal result". So I read I have to round the result because I am getting a number like 18.8888888....infinite decimals.
But I dont want to round this result because waht I want to get is 18.88 but although I am setting the scale to 2, it gives me the same error. I dont understand why I have to round this result and just get 18.88 setting the scale to 2. Is a way to do it?
Thanks