Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Even though you may only be using a couple decimal places, declare the
variables to hold these values as Double and not as Single. On my Excel2002 if the variable that holds 31.11 is a Single, the product will be 46.6650009155273 and both Round functions will give you 46.67. Or if the product is stored in a Single, the product will print out as 46.665 but the VB Round(x,2) will give 46.67. (One problem with using Option Explicit.) Mike H wrote: Hi, I'm not sure what the reassurance is you are looking for. Worksheet functions don't use 'Bankers' rounding so the result for .5 is always up. The VB round function uses 'bankers' rounding hence n.665 rounds to n.66. I'm sure there's a more involved explanation somewhere but in the meantime HTH. Mike "Ken Hudson" wrote: Just looking for some reassurance in my thought process. I want to multiply 31.11 by 1.5 in VB and I want VB to round the answer to 46.67. Using the Round function will give me 46.66. Using Application.Round is the method I need to get 46.67, correct? -- Ken Hudson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
rounding question | Excel Discussion (Misc queries) | |||
Rounding Question | Excel Discussion (Misc queries) | |||
Rounding Question | Excel Discussion (Misc queries) | |||
Rounding Question | Excel Worksheet Functions | |||
rounding question | Excel Discussion (Misc queries) |