The way I would handle it, assuming your working in PHP and currency
in dollars is:

// value of budget in dollars as stored in DB or as given by UI or
however you get it.
// if arithmetic is performed on this number as a float, your $10
might look like 9.9999999 from floating point errors.
$budgetValue=9.99999999;

// add .001 since this value will have no effect unless the third
decimal place is a 9 indicating a floating point error.
// then multiply by 100 to get 1000.<some erroneous decimal rounding
error>, then cast that to an int
$budgetValueInt = (int)(($budgetValue+.001)*100);  //yields integer
1000

// use string concatenation to get to a whole number micros
representation of the budget
$budgetValueToSet = $budgetValueInt."0000"; // yields string value
10000000 or $10 in micros

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

Reply via email to