I want to convert a pence value to pounds.
So I have something like this:
Code:
public double toPounds()
{
int itemPrice = 256;
int pounds = itemPrice / 100;
int pence = itemPrice % 100;
return pounds + pence;
}
The int pounds works returning the value 2.0 for the 2 pounds.
But its the pence im stuck on.
Can anyone help me out.
Thanks in advance.