... it won't print G2.
Do you get an exception? A blank output? A compile error? What do you mean by "it won't print G2"?
If you look at the logic a bit, by using the mod (remainder) operator the value of "o" will always be between 0 and 9. If it's zero, the first IF statement will handle it. If it's anything else then the second IF statement (0 <= 9) will evaluate to TRUE and so G2 will always be set to "+" for any digit 1-9. G2 will never be " " or "-". You might want to change the order of your IF clauses ...