Formatting battery info to an integer value