Price (and other monetary properties) in models should not be type double
See original GitHub issueIt’s generally a very-very bad idea to save money (prices, etc) in double
type. There’s a decimal
C# type just for mostly monetary purposes that won’t give you calculation, casting, rounding, comparing mistakes that real
types will give from time to time.
From what I see it’s classes:
- ShopifyCharge,
- ShopifyProductVariant,
- ShopifyCustomer,
- ShopifyLineItem,
- ShopifyOrder,
- ShopifyRecurringCharge,
- ShopifyShippingLine,
- ShopifyTaxLine,
- ShopifyTransaction,
- ShopifyUsageCharge
In case you have other things to do I can fix it on this or next weekend and pull-request.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Use money type in Entity Framework model first
I created a table that has a column called Amount and I set it as Decimal. I can't find where to set it...
Read more >Model Monetary Data
There are several approaches to modeling monetary data in MongoDB using the ... the double BSON type), decimal128 does not approximate decimal values...
Read more >Model Risk Management | Comptroller's Handbook | OCC.gov
Risk management for quantitative tools that do not meet the definition of a model ... Model risk should be managed like other types...
Read more >What Is the Capital Asset Pricing Model (CAPM)?
The Capital Asset Pricing Model (CAPM) helps to calculate investment risk and what return on investment an investor should expect.
Read more >Pricing Strategy
Pricing your product, giving complete and accurate quotations, choosing the terms of the sale, and selecting the payment method are critical elements.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for reporting this! I tend to get doubles and decimals confused, I don’t use them much in anything I’ve built for production. A pull request would certainly be welcome, otherwise I’ll get it when I have the chance.
All doubles have been change to decimals in the 4.0 branch.