So I'm trying to figure out some averages in a display script to print them out to the user and I have the following block:
And it produces this output:
When it should be 2.125, so I would at least expect to see 2.1
What am I doing wrong?
Code:
float avgSchematics = numSchematics/numTimesTaken;
print("Number of Times Taken: '" + numTimesTaken + "' totalSch: '" + numSchematics + "' avg:'" + avgSchematics + "'");
And it produces this output:
Code:
Number of Times Taken: '8' totalSch: '17' avg:'2.0'
When it should be 2.125, so I would at least expect to see 2.1
What am I doing wrong?