Android Question displaying '+' in front of positive numbers

Arf

Well-Known 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?
 

Arf

Well-Known Member
Licensed User
Nevermind, it was a simple addition to the output string:
B4X:
If Answer.StartsWith("-") = False AND (Answer = "0%") = False Then Answer = "+" & Answer
 
Last edited:
Top