What's turning star rating into a string?⭐

Our MySQL database has a stars column with type int(1). (for users giving 1 to 5 stars)
I query my DB with this selected column in my builder:
image
Dev tool gives me this:
image
Is AVG calculation or avgRating alias naming turning my int(1) into a string? How to remedy that so i can use ceil() and round()?

You seem to be trying to apply formatters expecting a number to a string value.
Apply the toNumber formatter to the value first and then to the ceil/round.

Thanks! So I take it that the AVG calculator (in aggregate) in the query builder turns my int(1) into a string, which is surprising.

Please check my reply here:

1 Like