This may be pretty simple but I've been searching for it and cant find it.  How to round to nearest 100?

back ground:  I'm working on a covered call strategy and want to purchase a certain % of the portfolio in a stock then sell covered calls on that amount.  To make it easy I want to calculate the number of shares to buy, store that number and devide it by 100 to know the number of calls to sell.  However, I dont know how to set holdings to a specific number of shares when the portfolio value should change over time (hopefully upwards :) ).  My plan was to use the following:

quantity = self.CalculateOrderQuantity("IBM", 0.4)

Then round the quantity value, and I know how to round to decimal places but how can I round up or down to 100? Once I have that value then I can purchase that specific number of blocks of 100s of shares and can easily sell calls on that number as well.

 

Thanks,

 

David