nus-cs2103-AY2324S2 / pe-dev-response

0 stars 0 forks source link

menu command supports adding items with costs and sales decimal figures with more than 2 decimal places #786

Open nus-se-script opened 7 months ago

nus-se-script commented 7 months ago

As shown here, I can add a menu item cake with cost 8.9999 and sales 9.9999. Some warning should be shown for this addition, as prices normally have a maximum of 2 decimal places.

image.png


[original: nus-cs2103-AY2324S2/pe-interim#1010] [original labels: severity.Low type.FeatureFlaw]

chonghaoen commented 7 months ago

Team's Response

This is intended. For situations where customers can only buy in sets of 2 cupcakes but users i.e. the business owners want to track the cost and sales of each individual cupcake, sales can often exceed 2 decimal places. When considering the cost of each cupcake based on the proportion of ingredients used, for example, 70g of flour of 1kg packet with price of 9.50, the cost of flour used would be $0.665. Hence, for accurate calculation of profits, it is possible that prices exceed 2 decimal places and we do not see the need to limit to 2 decimal places. Moreover, this app is designed mainly for business owners and not for display for customers. It is true that when displaying the prices to customers, we would limit it to 2 decimal places but that is not the intended use of Strack.

Duplicate status (if any):

--