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.
edit 2 income/123.12345
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
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
Labels:
type.FunctionalityBug
severity.Low
original: kikokidayo/ped#3