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] Incorrect floating point value handling for income when adding/editing contact causing incorrect display of income #211

Open soc-se-bot opened 7 hours ago

soc-se-bot commented 7 hours ago

When adding or editing a contact with the income field specified to include cents (e.g., 2000.95), the display incorrectly rounds down the value (eg. 2000.99 is displayed as 2000.00) instead of showing the precise amount (eg. 2000.99). The display is expected to retain two decimal places for accuracy.

This bug is classified to have a medium severity because social workers/other users who rely on precise financial information may find it essential to accurately record the income of their clients down to the cents. The lack of precision could lead to potential misinterpretations or data inaccuracies in cases where exact amounts are necessary for assessments or reports.

Suggestion: Ensure that the income is stored correctly as a floating-point number with 2 decimal places and displayed accurately as a floating-point number with two decimal places

Steps to reproduce: Run the add or edit command with the income field containing a value with 2 decimal places, where at least one digit after the decimal point is non-zero.

Eg.

Expected output: The contact's income should be displayed with the exact decimal value entered

Actual output: Contact's income is displayed with the 2 decimal places rounded down to 0

Screenshot 2024-11-08 at 4.42.57 PM.png


Labels: type.FunctionalityBug severity.Medium original: kikokidayo/ped#2

Gra7ityIC3 commented 7 hours ago

I think we should change the income field to an integer as the precision of floating-point numbers isn't necessary.