AY2425S1-CS2103T-F14b-1 / tp

https://ay2425s1-cs2103t-f14b-1.github.io/tp/
MIT License
1 stars 5 forks source link

[PE-D][Tester C] Income field allows more than 2 floating points when adding/editing contact #215

Open nus-pe-bot opened 7 hours ago

nus-pe-bot commented 7 hours ago

Since income cannot be measured with more precision than dollars and cents, the user input for income should be validated to ensure that more than 2 decimal places are prohibited. Right now a floating point value with many decimal places is treated as a valid value which may lead to incorrect data representation.

Steps to reproduce: Run the add or edit command with the income field containing a value which is larger than INT_MAX.

Eg.

Expected output: An error message on the output box stating that the user is not allowed to input an income with more than 2 decimal places OR truncating the income to only include 2 decimal places and successfully adding the contact

Actual output: Contact is successfully added/edited with a displayed income with 2 rounded down decimal places

Screenshot 2024-11-08 at 4.58.22 PM.png


Labels: type.FunctionalityBug severity.Low original: kikokidayo/ped#3