Hey Qake! Great to see people posting on the forums, sorry I'm just catching up with this
If you're looking for something with two decimal places, you could write
statText = '%.2f%%' % state['stats'][stats_list[i]['json']]
...which is a little confusing. I'll explain. In Python, the
% operator when used in a string will substitute bits in.
So you could write
thing = 'Tingbot'
print '%s is great!' % thing
and the program would print to console
Tingbot is great!. That's inserting a string into another string, but here you're inserting a number. And you want to print that number with only 2 decimal places. In that case, instead of writing
%s, you write
%.2f. The "
.2" part means 'print with only 2 decimal places'. Check https://pyformat.info/ for more info on how to do this kind of thing!
After that, you want to make the '%' sign. That requires
%% because when using this style of formatting a single
% has a special meaning.
All in all, that makes
'%.2f%%' % state['stats'][stats_list[i]['json']].
Hope that's helpful!