nus-cs2103-AY2223S1 / pe-dev-response

0 stars 0 forks source link

Overzealous Input Validation for PRICE (length limit 2dp) #255

Open nus-pe-bot opened 1 year ago

nus-pe-bot commented 1 year ago

image.png

A lot of items price have more 3 dp, but then the limit is only 2dp which shouldn't be the case and hinder the users from stating 3 dp prices. It makes the user losing the $0.009 which contributes to a lot given a lot of inventories


[original: nus-cs2103-AY2223S1/pe-interim#207] [original labels: type.FeatureFlaw severity.Medium]

RichDom2185 commented 1 year ago

Team's Response

https://docs.adyen.com/development-resources/currency-codes

By the official list of currency decimal places defined in ISO 4217 published by International Organization for Standardization, out of the 178 different currencies listed globally, only the Dinar has a currency of more than 2 decimal places. Any other price would be rounded during transactions. Our application can cater to more than 99% of currencies which we believe is sufficient.

4 d.p prices are only used in foreign exchanges, money exchanges, financial markets and places where values are extremely large or extremely high precision is required. In the context of inventory management, especially in small F&B businesses, 2 decimal places is a fair approximation. It is beyond extremely unlikely that they will require any additional precision.

Duplicate status (if any):

--