Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: Problems with number resolution

by Laurent_R (Canon)
on Jan 02, 2018 at 18:30 UTC ( #1206553=note: print w/replies, xml ) Need Help??

in reply to Re: Problems with number resolution
in thread Problems with number resolution

Yes, Math::BigFloat probably does it right. But it may be quite slow.

When dealing with monetary value having typically 2 decimal places, many (most ?) business databases actually store monetary values as integers with a scale factor of two (in other words, they store internally monetary amounts in cents instead of dollars or euros and perform the necessary conversions when needed). I guess this is deemed to be more accurate and probably faster. For tariffs related with usually small amounts (such as rating telephone calls), I have seen price rates actually stored internally as integers in 1/10,000 of a euro. But anytime the database engine reads from the database or writes to it, the scaling factor is applied. Most people using the database or even developing for it don't ever get to see this, as this is buried deep in the very low levels of the database software.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1206553]
[Corion]: ambrus: I think there was some discussion and maybe even an entry in Tidings, but I'm not really sure
[marto]: Back later, got to get the kids ready
[ambrus]: Also, I still have the suspicion that Perlmonks as a website is still horribly insecure, and that a malicious attacker could take over anyone's account easily, and I should tell the details of why I think this in some Cabal-only place.
[Corion]: But the site now is on https (only), and now also with one unified SSL certificate for all PM hoss
[ambrus]: This worries me a lot especially because as a cbstream maintainer, if this happens, I could get falsely blamed for any insecurity.
[ambrus]: Cbstream itself is also insecure because I abandonned it for too long, and it's really ripe for a full rewrite or something now.
[ambrus]: But that's a totally different issue.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2018-07-19 08:04 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (404 votes). Check out past polls.