VBA.VB6 - Rounding Function (greater or less than n digits)

The Round() function provides incorrect rounding the numbers of in the following form: (2a + 0,5) x 10^-n (Round half down) By cons, the numbers of the form (2a - 0,5) x 10^-n are usually Round half up. Author: Patrice33740 For example:

Round(0.15, 1) = 0.2 Round(0.25, 1) = 0.2 Round(0.35, 1) = 0.4 Round(0.45, 1) = 0.4

Rounding function given below does not have this anomaly:

Round(0.15, 1) = 0.2 Round(0.25, 1) = 0.3 Round(0.35, 1) = 0.4 Round(0.45, 1) = 0.5

Spread the love

Leave a Comment