How do you round a Double down to the nearest integer in VB .NET?
Are we talking VB.NET or VB6? In VB.NET use Math.Truncate.
This is pretty old, but the accepted answer of using Math.Truncate
is technically incorrect: Truncate rounds towards zero, not down. For example, -1.5 is rounded to -1 instead of -2.
In order to always round down, use Math.Floor
.