Kirito 5 Posted December 23, 2016 So now that i'm almost done muy profit/ph and Profit are not working correclty this is the code i'm using @Override public void onPaint(Graphics g) { timeRan = System.currentTimeMillis() - timeBegan; gpGained = picked - cost; totalGpGained = gpGained / 1000; DecimalFormat df = new DecimalFormat("#"); g.drawString(" "+ df.format(totalGpGained) + " ", 1,1); gpPerHour = (int)(gpGained / ((System.currentTimeMillis() - timeBegan) / 3600000.0D)); totalGpPerHour = gpPerHour / 1000; g.drawString("GP Per hour:" + df.format(totalGpPerHour) + "", 1, 1); g.drawImage(img1, 4, -1, null); g.drawString("Runtime: " + Timer.formatTime(System.currentTimeMillis() - startTime), 10, 260); g.drawString("Berries Picked: " + picked, 10, 280); g.drawString("Profit: " + cost, 10, 320); g.drawString("Profit/PH: " + totalGpPerHour, 10, 300); }
Kirito 5 Author Posted December 23, 2016 What about it isn't working? Ok so for now i got the Profit fixed but now i'm in trouble the profit/ph dosn't show up and just stands at "0"
Kirito 5 Author Posted December 23, 2016 Timer has a method for getting hourly amounts i'm fine now ^^
Recommended Posts
Archived
This topic is now archived and is closed to further replies.