I'm not sure if the reason my last zero is being cut off is because I am using double instead of float. It doesn't seem like that would be the case; however, when I have a number returned that should be 117.50, I am getting an output of 117.5
int gridPrice = 0; //collects price for grid number
double kiloHours = 0.0; //kilowatt hours variable
double baseKilo = 100.0; //sets hours charged at .50
double kiloOver = 0.0; /*finds the amount of Kilos over and subtracts
for accurate pricing*/
double kiloPrice = 0.0; //used to get the price or kiloHours
double totalAmtDue = 0.0; //collects the price due
System.out.print("How many sets of data do you have to input? ");
max = GetInput.readLineInt();
baseKilo = 100 * .50;
for (i = 1; i <= max; ++i)//loop to gather user info
{
System.out.print("Enter your full name: ");
name = GetInput.readLine();
System.out.print("Enter your grid number: ");
gridNumber = GetInput.readLineInt();
System.out.print("Enter the number of Kilowatt hours used: ");
kiloHours = GetInput.readLineDouble();
kiloOver = kiloHours - 100; ........}
This is just a small snippet of my code but as you can see I have declared my vars as double so I do not see a reason that this is happening.
Thank you for any help you can give