bleroy / Nwazet.Commerce

Idiomatic commerce module for Orchard CMS.
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Double is unsuitable data type for price #86

Closed armanforghani closed 7 years ago

armanforghani commented 8 years ago

I think we should change data type of price fields to decimal because double is not good choice to work with money. There are several references for that.

http://stackoverflow.com/questions/316727/is-a-double-really-unsuitable-for-money http://stackoverflow.com/questions/1165761/decimal-vs-double-which-one-should-i-use-and-when

bleroy commented 8 years ago

ok

MatteoPiovanelli-Laser commented 7 years ago

I am looking into this. A lot of interfaces will change, breaking things.

MatteoPiovanelli-Laser commented 7 years ago

I am having issues with the migrations for this. See the issue I opened in the Orchard repo https://github.com/OrchardCMS/Orchard/issues/7615.

The table is ProductPartRecord. The column DiscountPrice

I think I was able to change every other price to decimal, but I cannot seem to find how to fix the table there.

armanforghani commented 7 years ago

Great work. Thank you all so much.

MatteoPiovanelli-Laser commented 7 years ago

Not a problem.

@armanforghani would you share the url of any ecommerce you have live that uses Nwazet? I am curious as to what everyone else is using it for.