 Thread: Negative Numbers bug

1. Negative Numbers bug

I have a stats calculator in my program. It uses 4 counters per stat. The counters are named (depending on stat):
current
subtract
total

The current counter receives its value from an edit object
The add and subtract counters get theirs from altered global values named after themselves.
The formula I entered into total counter is like this:

Set counter to [color:#3333FF]value[/color]( [color:#6666CC]"current"[/color] )+[color:#3333FF]value[/color]( [color:#6666CC]"Add"[/color] )-[color:#3333FF]value[/color]( [color:#6666CC]"Subtract"[/color] ).

This means that the total counter may receive a negative value at some point, but when it is supposed to I want it to display a negative symbol and it does not for any negative values. For instance:

Global Value A is set to -5, and the subtract counter is supposed to receive this value. However it only receives 5 (not -5). I rearrange the events and formula to:

Set counter to [color:#3333FF]value[/color]( [color:#6666CC]"current"[/color] )+[color:#3333FF]value[/color]( [color:#6666CC]"Add"[/color] )+[color:#3333FF]value[/color]( [color:#6666CC]"Subtract"[/color] )

to compensate for the negative symbol not showing in the counter, and it successfully subtracts but still does not show a negative symbol.

All counters' values are set as follows:

initial value = 0
minimum value = -9999
maximum value = 9999

Is there a way for me to force a negative symbol to appear if the total counter goes below zero?  Reply With Quote

2. Re: Negative Numbers bug

Does the on-screen counter show a negative number if you set it directly? It would help to identify if this is a problem with the display of the counter, or with the formula used to get the result.

Does the counter show the correct value if you open it in the debugger? Is the counter perhaps not physically wide enough to display the minus sign, or (if a Numbers counter) has a minus sign animation frame that's blank?  Reply With Quote

3. Re: Negative Numbers bug

If I set initial value to a negative number it does  Reply With Quote Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•