cleaned battery percentage function