Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I set a variable as "single" and gather the value from in cell in Excel, say a percentage. When I spit out the same variable back to the worksheet, I got a slightly different number. For example 12% will become 0.1200000000542. Obviously this causes problem when I do data vailadion since these two numbers are now not equal. I don't want to round a number everytime when I deal with a number, any suggestion?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
you have to use Round or something similar. See http://www.cpearson.com/excel/rounding.htm for an explanantion why this happens In addition I won't use 'Single' but 'Double' as variable type. No real need for a 'Single' variable type -- Regards Frank Kabel Frankfurt, Germany Anson wrote: I set a variable as "single" and gather the value from in cell in Excel, say a percentage. When I spit out the same variable back to the worksheet, I got a slightly different number. For example 12% will become 0.1200000000542. Obviously this causes problem when I do data vailadion since these two numbers are now not equal. I don't want to round a number everytime when I deal with a number, any suggestion? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rounding Errors in 2007 | Excel Worksheet Functions | |||
Compensating for Excel rounding errors | Excel Discussion (Misc queries) | |||
Unwanted Rounding | Excel Discussion (Misc queries) | |||
Unwanted rounding of large number | Excel Worksheet Functions | |||
Rounding Errors Help | Excel Discussion (Misc queries) |