Money type

IGotD- nise at nise.com
Wed Jan 1 18:46:20 UTC 2020


On Wednesday, 1 January 2020 at 18:16:01 UTC, Vitaly Livshic 
wrote:
>  Thanks Steve, JN.
>
>  JN, BigInt is big integer. It cannot works with fractional 
> numbers. It is sadly, that wide-spread languages have no 
> convinient money type. This is abnormal.
>  Hope, D will have fixed point type either as built-in type or 
> library.

That's probably because there is no standard how to deal with 
currencies. Think about Shillings and it goes 12 pence on one 
Shilling, weird stuff like that.

Also why use fixed point? Why not have currency * 100 as there 
goes hundred cents in one base currency, for many currencies. To 
convert it back you just divide by 100 and you get the value and 
the cent value. Well * 100 is fixed point, but in computer land 
fixed point usually means some scale factor of the power of 2.


More information about the Digitalmars-d mailing list