Thanks, typecasting to (float) fixed the problem. Integer casting yields to bad results. Never ever should cast microAmounts to int in php5.
On Apr 5, 5:22 pm, AdWords API Advisor <[email protected]> wrote: > Hi Kemal, > > It looks like your second bid, 259.71, wasn't converted correctly: > > <ns1:budget xsi:type="ns1:Budget"> > <ns1:amount xsi:type="ns1:Money"> > <ns1:microAmount>259709999</ns1:microAmount> > </ns1:amount> > </ns1:budget> > > Are you using floats to store microAmount values? > > Best, > - Eric Koleda, AdWords API Team > > On Apr 2, 5:58 am, Kemal <[email protected]> wrote: > > > > > Hello, > > > Some of my budget mutate requests get > > NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT, most don't, and all the values > > are rounded with 2 digits after the decimal point (well, converted to > > microUnits afterwards, obviously) > > > Setting budget to 241.38 works, but setting another campaign's budget > > to 259.71 won't work. Two different campaigns. First reqid is > > 63ee80f03c3f81471f23a12c04861069, and the second one is > > 5dfcf48d3f485c1ec6d3c4ab29b44670. > > > I actually wrote some exception handling code that, if it encounters > > BudgetError.NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT the first time, it > > will try again with a fully-rounded budget amount (260 instead of > > 259.71) > > > Again, the numbers are converted to microUnits (multiplied by 1000000) > > before they are passed into the Money() constructor. > > > By the way I couldn't find any info about minimum money units in the > > documentation. In fact, a clear documentation about microAmount/Money > > and reference to it in the CampaignService.BudgetError page would be > > really useful for new implementors. > > > Best, > > Kemal -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en To unsubscribe, reply using "remove me" as the subject.
