Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Incorrect results in Infopath calculation - might be a bug?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lan Hoa Ha - 12 Jan 2006 18:16 GMT
Hi there,
I believe there are something wrong with some particular calculations in
Infopath as follows:

One form includes a repeating table with 3 columes: field 1 at colume 1,
field 2 at colume 2, field 3 at colume 3. When value in field 1 multiplies
with value in field 2 and the result is in field 3, sometimes the results are
not consistent in the places of decimal:

   Field 1 * Field 2      Field 3    
(1) 2.49   *  4500   =  11,205.000000000 and
(2) 2.47   *  4500   =  11,115

(3) 2.49   *  3000   =  7,470.000000000   and
(4) 2.49   *  1000   =  2490

As you see in the (1) calculation, can you please explain me why how come
this could give a result with ".000000000" while the (2) gives no decimal?
Hope you see my point. The same thing happens for the (3) and (4). Please
also be noted these figures: 2.494, 3.49, 2.499, 2.99 also generate result
with nine decimals when multiply with 4500 or 5000 or 7000 or 9000...And they
give no decimal when multiply with 4900, ...???

Just to give you more background: all the three fields here are formated as:
Data type: Decimal (double)
Decimal format: Number
                      Decimal places: Auto
                      Use a digit grouping symbol: checked
......

Please kindly have a look at this and reply to us at your earliest
convenience.

Many thanks !
Bojana Marjanovic [MSFT] - 16 Jan 2006 21:34 GMT
InfoPath uses XPath 1.0 which uses binary arithmetic instead of decimal
arithmetic.  Because of this, you'll get the results listed below.

-Bojana

> Hi there,
> I believe there are something wrong with some particular calculations in
[quoted text clipped - 43 lines]
>
> http://www.microsoft.com/office/community/en-us/default.mspx?mid=347dd889-d68e-4
4be-bfe7-5be42d5792e8&dg=microsoft.public.infopath
 
Bojana Marjanovic [MSFT] - 16 Jan 2006 23:03 GMT
More details on this:

Floating point is the correct terminology here.

XPath uses floating point arithmetic which means that results will be
inaccurate.

In this case, the number returned is 11205.000000000001.  The display engine
truncates this to 11205.000000000 since NLS can only display 9 decimal
digits.

So, yes, this is a bug, but we can't fix it.

> InfoPath uses XPath 1.0 which uses binary arithmetic instead of decimal
> arithmetic.  Because of this, you'll get the results listed below.
[quoted text clipped - 53 lines]
>>
>> http://www.microsoft.com/office/community/en-us/default.mspx?mid=347dd889-d68e-4
4be-bfe7-5be42d5792e8&dg=microsoft.public.infopath
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.