News for hackers. Stuff that matters.
Re:Wirecard files for insolvency after financial hole laid bare by hef19898 on Thursday June 25, 2020 @08:09AM (#23639691)
So basically the cardinal sin of payment processing then? Not that I'm surprised.
Re:Wirecard files for insolvency after financial hole laid bare by codegladiator on Thursday June 25, 2020 @08:24AM (#23639830)
I say cardinal sin would have been not storing amounts as integer.
Re:Wirecard files for insolvency after financial hole laid bare by kyrra on Thursday June 25, 2020 @09:36AM (#23640555)
(googler, opinion my own)

Just go give 2 ways of doing money storage in ints from Google's APIs...

For Google's Standard Payments APIs, we use micros: https://developers.google.com/standard-payments/v1/fops/bank...

> To represent a monetary value in micros, multiply the standard currency value by 1,000,000.

> USD$1.23 = 1230000 micro USD

Sadly, its different than other parts of Google with money/amount based APIs. GCP uses units + nanos: https://cloud.google.com/billing/v1/how-tos/catalog-api

> [UNITS] is the whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.

> [NANOS] is the number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

Re:Wirecard files for insolvency after financial hole laid bare by nitrogen on Thursday June 25, 2020 @10:53AM (#23641441)
From reading other comments it seems that "micros" aren't precise enough to represent one satoshi if the unit is whole bitcoin.
Re:Wirecard files for insolvency after financial hole laid bare by rudiv on Thursday June 25, 2020 @08:35AM (#23639932)
There's a cardinal pun somewhere in there but I can't think of it.
Re:Wirecard files for insolvency after financial hole laid bare by salawat on Thursday June 25, 2020 @09:19AM (#23640372)
Bird, position in the Catholic hierarchy, countability, or direction wise?

Something to do with using floats to indicate cardinality briefly plummeted, but was summarily dismissed.

Regardless, losing track of the numbers to accounts reminded me of this one place I worked where the transaction geese weren't recorded as explicit callouts on the transaction ledger, but rather had to be cross-referenced with final transaction amounts and the fee configuration for time period, but where the changing of fee configurations were not tracked with a granularity sufficient for resolving all ambiguity come audit time.

And I thought that was bad.

Re:Wirecard files for insolvency after financial hole laid bare by jojobas on Thursday June 25, 2020 @09:04AM (#23640212)
... but I can't place it.
Re:Wirecard files for insolvency after financial hole laid bare by messe on Thursday June 25, 2020 @09:41AM (#23640616)
This would be a top tier joke if only we could rank it.
Re:Wirecard files for insolvency after financial hole laid bare by tlarkworthy on Thursday June 25, 2020 @09:02AM (#23640191)
No losing the user-to-number relation is way worse than a bad number representation.
Re:Wirecard files for insolvency after financial hole laid bare by billman on Thursday June 25, 2020 @08:44AM (#23640010)
Just curious, how would you manage bitcoin fractional shares.
Re:Wirecard files for insolvency after financial hole laid bare by deevolution on Thursday June 25, 2020 @09:08AM (#23640262)
Bitcoins are represented as integers. A whole Bitcoin is 100MM satoshis.

Typedef int64_t CAmount;

Static const CAmount COIN = 100000000;

Static const CAmount MAX_MONEY = 21000000 * COIN;

https://github.com/bitcoin/bitcoin/tree/master/src/amount.h

Re:Wirecard files for insolvency after financial hole laid bare by gruez on Thursday June 25, 2020 @09:00AM (#23640176)
Why would you need fractional bitcoin shares? The smallest unit of bitcoin isn't 1 bitcoin (like with stocks), it's 1 satoshi or 0.00000001 bitcoin.
Re:Wirecard files for insolvency after financial hole laid bare by granitepail on Thursday June 25, 2020 @08:49AM (#23640065)
Arbitrary precision arithmetic.