cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain RODRIGUEZ <>
Subject Re: Can we set the precision of decimal column
Date Thu, 25 Apr 2019 16:09:17 GMT

My 2 cents? Do not use floats for money, less for billing. It has never
been good for any database due to the representation of that number for the
computer. It's still the case with Cassandra, and it even seems that
internally we have a debate about how we are doing things there:

I would use an integer type and create an interface that will multiply the
number by 10 000 where storing it and divide it by the same number when
reading it. This way, no imprecise representation of your number for the
machine anymore. I said 10000 arbitrarily because I've never seen a system
that would need more, but it can be 100 or 100000 depending on how big the
number you work with are and the precision you want to keep.

Alain Rodriguez -
France / Spain

The Last Pickle - Apache Cassandra Consulting

Le mar. 23 avr. 2019 à 06:04, xiaobo <> a écrit :

> Hi,
> We usually use decaimal data type for money, can we set decimal columns
> with a specific precision?
> Thanks.

View raw message