This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
tubs5's profile picture

percent counting

Started by tubs5, 04 June 2014 - 07:24 AM
tubs5 #1
Posted 04 June 2014 - 09:24 AM
Hi!
I Started a program to count energy. But i want it in percent and the only way i can come up with is IF statements. Their must be a easier way.
Please help
CometWolf #2
Posted 04 June 2014 - 02:34 PM
lol, don't you learn this stuff at school?

(curEnergy/maxEnergy)*100 = percent
KingofGamesYami #3
Posted 04 June 2014 - 02:38 PM
Doing that to make a proper variable

local percent = (current/max)*100