Function to check if Track Number is empty

Having difficulty getting this formula right, I have searched the forums and couldn't find any threads with the same issue I am experiencing.

I want to assign to Tag-to-Filename , using a function that will apply a Track number before the Title IF there is a number present in the Track Number field.

As of now with an empty Track Number using, %genre%\%album%$num(%track%,2) - %title%

I get the zeros into the filename: "00 - Track.mp3"

Since not all of my mp3's have Track listing details, I don't want the 00's popping up everywhere...

What function can I use to check the Track Number field? So if the Track Number is blank, the filename yields: "Track.mp3"

[$num(%track%,2) - ]%title%

If you put code in square brackets, it will only be returned if at least one placeholder inside is not empty.

Question is already answered by dano in post #2, but for your interest here are more variants of the same old theme.

$if(%TRACK%,$num(%TRACK%,2)' - '%TITLE%,%TITLE%) $if(%TRACK%,$num(%TRACK%,2)' - ',)%TITLE% [$num(%TRACK%,2)' - ']%TITLE%