If you want to keep track of your income, what data type of variable would you use and why?
Qus: If you want to keep track of your income, what data type of variable would you use and why?
Ans:
Usually income is stored in Numeric datatypes. But to be more specific and accurate, We should use Decimal Datatype.
The decimal data type is an exact numeric data type defined by its precision (total number of digits) and scale (number of digits to the right of the decimal point). For example:
So, When we need accurate calculations for money or currency , interests, loans etc, the decimal data type is suitable for storing currency data where the required range of values or number of digits to the right of the decimal point exceeds the capacities of the money data type.
Hope It helps!
Thumbs up ;)
Get Answers For Free
Most questions answered within 1 hours.