3 ms·
Equally important to choosing a valid numeric type to store the data is solid business logic to handle it. In the contrived example of splitting a value of 999
by mjevans 8y ago
Equally important to choosing a valid numeric type to store the data is solid business logic to handle it.
In the contrived example of splitting a value of 999.99 among more than one payment, the correct solution is:
* Determine the next payment based on the current balance.
* Invoice/Apply/Etc that payment
* Repeat until there is a balance of 0 (zero).
- lowercased 8y agorecording an incoming payment and applying that payment value to specific accounts is its own thing to be aware of. People want to see that they paid $200, even if it was $150 to one account and $50 to account.