Android Question displaying '+' in front of positive numbers

Discussion in 'Android Questions' started by Arf, Jun 3, 2015.

  1. Arf

    Arf Active Member Licensed User

    I have a 'percentage change' number I wish to display, ie:
    old result = 55
    new result = 66
    perc change = 20%

    which I would prefer to display as +20%

    Is there any way I can force NumberFormat or a similar function to print a + sign automatically in front of the number as it would a - if the number was negative?
     
  2. Arf

    Arf Active Member Licensed User

    Nevermind, it was a simple addition to the output string:
    Code:
    If Answer.StartsWith("-") = False AND (Answer = "0%") = False Then Answer = "+" & Answer
     
    Last edited: Jun 3, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice