CampaignCriterion.bidModifier returned with many decimal places normal?

27 views
Skip to first unread message

JC Lee

unread,
Mar 13, 2017, 8:55:05 AM3/13/17
to AdWords API Forum
Hi,

I am doing a CampaignCriterionService->mutate() operation with a bidModifier value of 1.05. The return value I get back is 1.0499999523163. Is this normal?

Shouldn't the API round it up to 2 decimal places before sending it back?

Shwetha Vastrad (AdWords API Team)

unread,
Mar 13, 2017, 12:34:22 PM3/13/17
to AdWords API Forum
Hi,

Because there are only a finite number of double-precision numbers, you cannot represent all numbers in double-precision storage. On any system, there is a small gap between each double-precision number and the next larger double-precision number. Because of this, many numbers will have small changes to allow them to be stored. I suggest that you round up the value returned in the response to two decimal digits as shown in the SetBidModifier.php example. 

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages