Of course, this is exactly what the decimal data type is for!
"Exactly"? To quote MSDN*;
Compared to floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations.
Treating the items as integers in monetary applications prevents a lot of common errors, like wrong boxing/unboxing, rounding errors, wrong conversions and/or picking an inappropriate datatype. If you count whole items, there is no rounding, and cents only come in whole-variants.
*) MSDN agrees, I don't. Show me 0.000783678 cents and I might change my mind
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
In the US, the 1/10th of a cent unit is still legally defined and used in some contexts. Mill (currency)[^]
In any case, the point is that accurate financial arithmetic in units of less than a cent is still a requirement in some cases and using only integer cents can still lead to difficulties.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton