www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Decimal type documentation

reply "Poyeyo" <poyeyo arcadechaser.com> writes:
Hello, has anyone used this https://github.com/andersonpd/decimal 
implementation?

I'm learning D and want to know where to start for the decimal 
(or bigfloat) stuff.

The goal is to be able to read and write some data from a SQL DB 
with a decimal(10,2) field.
Jun 10 2014
parent "Tim" <nrgyzer gmail.com> writes:
On Tuesday, 10 June 2014 at 15:52:29 UTC, Poyeyo wrote:
 Hello, has anyone used this 
 https://github.com/andersonpd/decimal implementation?

 I'm learning D and want to know where to start for the decimal 
 (or bigfloat) stuff.

 The goal is to be able to read and write some data from a SQL 
 DB with a decimal(10,2) field.
I recently tried this implementation without any success. I always got conflicts. I had the same problem. I had to read a decimal(32,8) value from my database. I figured out that the best solution for my case is to simply use the phobos implementation for BigInt. I'm simply converting the decimal-value to an integer (using multiplication) and use this instead of solving all the conflicts of the library above.
Jun 11 2014