tax rate and large value question

so my program asks the user for the price of an item, the number of items bought, and the tax rate. i was wondering if the formula is
((price of item*number of items) + (((price of item*number of items)*tax rate))) ?

on a side note, int number=9000000000; doesnt give the right value, how else can i store it?
closed account (SECMoG1T)
long long int or long double
((price of item*number of items) + (((price of item*number of items)*tax rate))) ?

I'm not sure why there'd be addition in there?

1. price of "one taxed item" = price of item * tax rate = A
2. price of X taxed items = A * number of items

OR multiply the price and quantity and then apply the tax. It doesn't matter.
Topic archived. No new replies allowed.