Author Topic: [solved]Negative Numbers in Parenthesis  (Read 1633 times)

jaised

  • Guest
[solved]Negative Numbers in Parenthesis
« on: April 08, 2013, 04:03:01 PM »
So when I do math calculations and receive a negative number, put it into a label, I get "(50)" as the representation for -50. Why does NGUI do this? How can I get it to recognize that it's a negative number and make it actually display a negative number? I have searched all through UILabel and haven't seen anything that modifies / controls this behavior. Any help to make this fix would be appreciated. Thank you.
« Last Edit: April 08, 2013, 05:16:26 PM by Nicki »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Negative Numbers in Parenthesis
« Reply #1 on: April 08, 2013, 04:08:33 PM »
How do you put it into the label?

try using myInt.ToString()

jaised

  • Guest
Re: Negative Numbers in Parenthesis
« Reply #2 on: April 08, 2013, 05:15:11 PM »
I figured it out. It's because when using string.Format with "C2" option, .NET treats currency like that. So if anyone else encounters this, that is what is happening.