If an operator is the first thing in your expression, or comes after another operator, or comes after a left parenthesis, then it's an unary operator.
You have to use other symbols for unary operators in your output string, because otherwise it is not possible to distinguish between binary and unary variants in the postfix notation.