Thread: Rounding
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Rounding

be aware that VBA's Round() method and XL's ROUND() function differ in
how they round numbers that have 5 as their terminal digit. XL's ROUND()
always rounds away from zero (i.e., arithmetic rounding) and VBA's Round
rounds to the nearest even number (i.e., "banker's rounding"):


x Round(x,1) =ROUND(x,1)
1.05 1.0 1.1
1.15 1.2 1.2
1.25 1.2 1.3
1.35 1.4 1.4



In article , "Andy Wiggins" <xx
wrote:

Sub RoundTest()
Dim x
x = 1.2345
Debug.Print Round(x, 1)
End Sub