|
Post by turtleman on Mar 9, 2022 6:13:10 GMT -5
Since switching to a monospacing font, decimal alignment in graphic box columns looks terrific … with one exception – an initial negative percentage of -100.
Percentage in this simplified example is called finalpc and calculated as shown below:
if wagered > 0 then finalpc = (final/wagered * 100)
Then finalpc is displayed in a graphic box using:
#stats.finalpc, "place 2 13; font Consolas 11"
#stats.finalpc, "\" ; using("###.##", finalpc)
That works as it should EXCEPT if finalpc is initially -100
For example:
final = -5
wagered = 5
finalpc should be displayed as -100.00, but instead shows up as %-100.00
All other finalpc values, positive or negative, display correctly without the leading %
I don't have a clue where the % comes from or how to get rid of it. If using("###.##" is removed, the leading % character goes away! Of course, the decimal will no long align with the other displays and jumps around depending on its value.
I've spent an entire day trying to figure this out, and it won't hurt my feelings (too much) if someone can show me the silly error of my ways! Thanks!
|
|
|
Post by Rod on Mar 9, 2022 6:44:23 GMT -5
The % symbol is telling you that you have not allowed enough room in the mask for the number you give it to be displayed. Increase the mask to using("####.##" This will allow the - symbol to be shown if needed.
|
|
|
Post by turtleman on Mar 9, 2022 7:09:45 GMT -5
Thanks Rob - that does it! I guess I should have tried that sooner, but am still surprised the % shows up! Adding the extra # in the mask will require doing the same for all the other graphic boxes that don't need the extra #. I was going to "readjust" the displays for additional spacing anyway and now have an extra reason.
|
|
|
Post by tsh73 on Mar 9, 2022 8:40:48 GMT -5
Now you have nice reason to use variable for a mask
mask$="###.##" ... #stats.finalpc, "\" ; using(mask$, finalpc) After that you will be able to change it in single place.
|
|
|
Post by turtleman on Mar 9, 2022 9:57:28 GMT -5
It's finally starting to make sense to me. Back to the drawing board!
Need to think things through a bit more. While many of the displays, particularly percentages, require only a few digits, the range of others can vary from 1 to as many as 8 digits.
|
|