Hi,
I am formatting some data coming from an excel file. The data (excel cells values) can be empty, 0 or contain a number. Formatted data is then populated in a word template.
I only want to format cells that contain a number, and output “-” for empty cells and cells containing a 0.
For now, I am only checking for empty values :
if(empty(items('Apply_to_each')?['Revenue Total']), '-',
formatNumber(float(items('Apply_to_each')?['Revenue Total']), 'N2'))
I would like to add something along the line of
if(equals(items('Apply_to_each')?['Revenue Total'], 0), '-',
items('Apply_to_each')?['Revenue Total'])
But it doesn’t work as the function still ouputs 0 instead of “-” (see screenshot below):
I would like to understand why the expression is not recognizing the 0 value as a 0. I tried comparing with “0” but I get an error (probably due to comparing a number to a string).
Any help would be appreciated, thanks for reading !