How would you calculate compound interest without being able to use any double values. There is also a need for an exponential value. How do I accomplish it. Help...anybody... shirl

Shirl, Welcome to JavaRanch! We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy. Thanks Pardner! Hope to see you 'round the Ranch!

treat all monetary amounts as integral numbers of pennies then, break the result into its dollar and cents amount, via division and the modulus operator.

OK. That sounds not too bad.

The integer devision to calculate amountInDollars will always truncate. The modulus operator ('%') will give the remainder.

Bill

Shirl Diva
Greenhorn

Joined: Sep 09, 2002
Posts: 21

posted

0

Okay, I am going to try this % once again. I can't seem to get to work. It had to be in all ints - I can't use Math.pow without a double value. Thanks though