Round a Number to Any Precision

Category:
Dates and Math
Type:
Snippets
Difficulty:
Beginning
Author:
Marcel Slooff

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
Round a number to any specified precision. eg. round $2.03 to $2.05 as follows: RoundTo(2.03, 0.5). Or round 11839 to 11840 as follows: RoundTo(11839, 10).

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: