I build custem stars column (text) from number float column using this function.
Code:
def evaluate(self, formatter, kwargs, mi, locals, r):
try:
m = float (r)
n = int(m)
if 0.00 <= m - n <= 0.25:
x = n * '★'
if 0.25 < m - n <= 0.75:
x = n * '★' +'½'
if 0.75 < m - n <= 1.00:
x = (n+1) * '★'
except:
x = ''
return x
It works well but I have a few question:
- Is there a way to use an half star in text?
- The funny thing is that in the catrgory is show half stars rating, but it doesn't show any books.
- From 2.67 there is half star option in the custem star column, can I build star column from float column?