I can’t find a solution to fix the number_format() expects parameter 1 to be float, string given. Above is a snippet of the code and using switch instead of else/if.
I only see this in post edit where the block is used. Frontend is fine once I echo '-'; if null or empty. it’s an number field on a post type and I filter it to have thousand separator if the value is filled. But since and empty is passing a string it cause the php warning. I can not find a solution via StackOverflow, feel like I’ve tested everything.
I assume someone played with number_format() before and faced the same issue.