The data type of your fields is probably set to "Text (string)".
Double-click on each field to open its properties dialog box and select
"Decimal (double)" from the "Data type" dropdown list box on the "Data" tab.
The calculations should then be performed correctly.
S.Y.M. Wong-A-Ton
Thanks a lot for your reply.
However, this issue has nothing to do with the Data type since I have tried
to change all the possible data types listed. It could be best if you
yourself try this calculation in Infopath, you yourself should see it. I
believe there are something wrong with some particular calculations as
follows:
(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, ...??? It must not be because of the
data type of the field, must it ?
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 !
> The data type of your fields is probably set to "Text (string)".
>
[quoted text clipped - 15 lines]
> > Can you help me why it is?
> > Thanks
S.Y.M. Wong-A-Ton - 12 Jan 2006 07:59 GMT
Your original post stated that calculations where being performed
incorrectly, as in
4500 * 2.49 = 11205.000000000001
(Note the 1 as the last decimal digit)
This only happens when the data type of your fields is set to "Text
(string)". After you changed the data type to "Decimal (double)" like I
suggested, the precision of the calculation was corrected, as in
2.49 * 4500 = 11,205.000000000
So to state that this has nothing to do with data types is not entirely
correct.
You are currently being challenged by the amount of decimal places which are
inconsistently being shown for certain calculations. I DID check your
calculations and you are right, so this might be a bug in InfoPath.
If you do not want digits to be shown after the decimal point, just change
the "Decimal places" property in the "Decimal Format" dialog box from "Auto"
to 0, or use a "Whole Number (integer)" as the data type.
I'm not sure how you can submit bugs to Microsoft. Perhaps you should repost
your issue as you explained it in your second post and make the comment that
it is a suggestion for Microsoft.
Hope this helps.
S.Y.M. Wong-A-Ton
> Thanks a lot for your reply.
>
[quoted text clipped - 48 lines]
> > > Can you help me why it is?
> > > Thanks
Lan Hoa Ha - 12 Jan 2006 18:20 GMT
Thanks a lot. It really helps though.
I did repost the question as "Incorrect results in Infopath calculation -
might be a bug?", please kindly vote for it so that Microsoft will look into
it for a better explaination.
Thanks !
> Your original post stated that calculations where being performed
> incorrectly, as in
[quoted text clipped - 80 lines]
> > > > Can you help me why it is?
> > > > Thanks
S.Y.M. Wong-A-Ton - 12 Jan 2006 18:39 GMT
Done!
> Thanks a lot. It really helps though.
>
[quoted text clipped - 88 lines]
> > > > > Can you help me why it is?
> > > > > Thanks
S.Y.M. Wong-A-Ton - 12 Jan 2006 13:56 GMT
You can make a suggestion to Microsoft here:
http://www.microsoft.com/office/community/en-us/wizard.mspx?type=suggestion
> Thanks a lot for your reply.
>
[quoted text clipped - 48 lines]
> > > Can you help me why it is?
> > > Thanks