Boolean output to numeric value from state node?

How would I configure boolean state output to send:
0 or 4 based on it’s state?
Something like:
image

{"day_code": $entity().state ? 4 : 0}