mercredi 17 juin 2015

Sqlite Rounding

SUM(ROUND((price)-((price* TAX)/100 + purchaseprice),2)) as'"+PROFIT+"'

"PROFIT" without Rounding is 15.0057 and with it is 15 instead of 15.01

"TAX" is the percentage for example "19%" but stored without the "%" no problems there.

price and purchaseprice are stored as numeric.

What do i have to change to get 15.01 instead of 15. A better solution for me would be to format "PROFIT" somehow with NumberFormat currencyFormatter = NumberFormat.getCurrencyInstance();

Aucun commentaire:

Enregistrer un commentaire