Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dave O
 
Posts: n/a
Default Excel adds phantom decimal places: why?

By coincidence, two posts today have asked about Excel adding phantom
decimal places to entries:

http://groups.google.com/group/micro...36d0799e3421d4

http://groups.google.com/group/micro...2abd3771aaa94f

I have experienced this as well: when I enter a dollar amount with just
2 decimal places and convert those values to variables in VBA code,
Excel adds trailing decimal places. These do not affect the dollar
value, but they do create problems when performing a comparison, such
as
If TotalBux = 0 Then (etc)
In this example, the value of TotalBux can be so close to zero that it
makes no effective difference: except that mathematically it does not
equal zero due to the decimal places, creating an internal logic flaw.

The workaround is to round to an appropriate number of decimal places,
but why does this happen?

  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

See

http://cpearson.com/excel/rounding.htm

In article .com,
"Dave O" wrote:

The workaround is to round to an appropriate number of decimal places,
but why does this happen?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel decimal format mlou Excel Discussion (Misc queries) 10 March 1st 10 11:16 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
decimal places within a formula Paul01 Excel Discussion (Misc queries) 4 June 3rd 05 07:53 PM
DECIMAL PLACES IN FORMULAS excllent 1 Excel Worksheet Functions 5 June 1st 05 06:43 PM
Numbers after decimal point excel to word mail merge Andy P Excel Worksheet Functions 1 March 15th 05 12:48 PM


All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"