SyntaxFix
Write A Post
Hire A Developer
Questions
Casting will ignore anything after the decimal point, so 8.6 becomes 8.
Convert.ToInt32(8.6) is the safe way to ensure your double gets rounded to the nearest integer, in this case 9.
Convert.ToInt32(8.6)