Tristan Caron
01/17/2019, 7:57 PM1.3.11
Czar
01/17/2019, 8:06 PMTristan Caron
01/17/2019, 8:18 PMBigDecimal
but the result is still the same.Czar
01/17/2019, 8:31 PMval totalHt = items.fold(BigDecimal.ZERO, BigDecimal::add)
Tristan Caron
01/17/2019, 8:42 PM4296.5999999999
but 4296.6
because I only have 1 item with price = 0.6
and quantity = 7161
Thanks for the tip, I use BigDecimal.ZERO 🙂Czar
01/17/2019, 8:43 PMDouble
what you are describing should be impossibleBigDecimal
with a Double
, check this screenshotTristan Caron
01/17/2019, 8:51 PMCzar
01/17/2019, 8:54 PM0.6
precisely.Tristan Caron
01/17/2019, 9:01 PMCzar
01/17/2019, 9:09 PMBigDecimal
<-> BSON String
mappingTristan Caron
01/17/2019, 11:07 PMShawn
01/17/2019, 11:23 PMTristan Caron
01/17/2019, 11:25 PMval totalTtc = decimalFormat.format((totalHt + (totalHt / 100) * invoice.taxPercent).toString().let {
it.substring(0, it.indexOf(".") + 4)
})
Shawn
01/17/2019, 11:48 PMTristan Caron
01/17/2019, 11:49 PMShawn
01/17/2019, 11:52 PMTristan Caron
01/17/2019, 11:53 PMShawn
01/17/2019, 11:54 PMTristan Caron
01/17/2019, 11:54 PMShawn
01/17/2019, 11:54 PMTristan Caron
01/17/2019, 11:58 PM