June 10, 2014 Decimal type documentation | ||||
|---|---|---|---|---|
| ||||
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. | ||||
June 11, 2014 Re: Decimal type documentation | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Poyeyo | 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.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply