Format Data Output

Posts: 28
Hi Everyone,

Great to see this forum kicking along well.

I've asked this question before and got an answer, but, I cannot seem to get the result I am looking for.

I am trying to get the 'positiongain' data binding to have a '+' or a '-' representing if the driver has gained or lost positions. In the data text field, I have the following "{0:+#;-#;0}"

With this in place, where a driver has lost positions, the data is displayed correctly. However, there is no '+' displayed where a driver has gained positions and nothing where they have not changed.

Can you please let me know where I have gone wrong?

Thanks,
Alex.
Posts: 785
Your format string looks correct, and when I try it, it gives me the correct output.
-1 remains -1
1 turns into +1
0 remains 0 (not +0).

Can you make sure it is written exactly like this: {0:+#;-#;0}
Edited (1 time)
Posts: 28
Thanks Nick,

I will have another go with a copy and paste from your post and confirm.

Much appreciated.
Posts: 28
I'm hoping the images that I have attached work. One is the values in the widget with the positiongain value circled. The other is what the data binding and text values are in the editor. Can't explain why it doesn't work.

I updated the theme with the copy & pasted value of what you typed. Looks the same as what I had, but, you never know right?

Any help would be greatly appreciated.


Posts: 28
Still cannot find the resolution to this one. I seem to have issues applying numeric formatting more broadly.

I have looked at your data binding thread that references how to format data outputs (https://atvo.appgineering.com/Forum/Thread/12). But, I appear to have issues even with something as simple as having the number of decimal places being 1 rather than 3 despite following the guide. I can't figure out where I am going wrong.

Any help or advice would be greatly appreciated.

Thanks,
Alex.
Posts: 785
I don't know why it's not working for you, it should work fine...

Maybe it is related to your computer language setting? Can you try changing that and seeing if that has any effect? It shouldn't but who knows...
Posts: 28
Hi Nick,

Thanks for your message. I tried changing the language from English Australian to English US. No joy I am afraid.

You're right. No doubt, it should just work.

I started a new theme to check. Still no success. I was going through the thread on iRacing forums and we have been over this before. For some reason, I feel like I must be doing something wrong....

Posts: 28
Interestingly, in the editor, if I toggle 'Design Mode' and the included data becomes visible, the '+' symbol is visible (see first pic). However, if I connect to a session and use live data, it is not (see pic 2).




Posts: 785
Still can't reproduce, it works for me in live mode, debug mode, in theme editor and in ATVO. Can you send me your theme?
https://www.dropbox.com/request/Wzy1E1fcJiBCcjh8kESd
Edited (1 time)
Posts: 28
Thanks Nick.  I have sent through the theme.

You will find the label in the set of widgets near the top of the list in the race results section.  Each position has a widget with a SW and a label for PosChange eg "L_Results_P1_PosChange". I know it is convoluted, but, it was how I got animations to work :-).

I hope it is that I am doing something silly.

Thanks again.
Edited (1 time)
Posts: 785
Does it work with other numeric values, say customer id, or position, or anything else?
Posts: 28
What I have tested it with is decimal places with times. eg '1.234' seconds. I am unable to get the output to less decimal places than the original value (ie 1.2 in this example). I have not tried the values you have suggested, but, have not had any luck formatting output where I have tried.

Thanks for your investigations.
Posts: 28
Other data example. This one using livegap. It accepts the data formatting (as in doesn't throw a format error), but doesn't seem to apply the format.

I wondered if the format being applied in this case was not applicable to the data output. I did also try {0:0.0}.


Posts: 81
hi yes hello it's me bumping another old as hell thread

Was this issue ever resolved by anyone? I'm having the same problems Alex was, I've tried copying the exact string but cannot get a + to appear in front of the number. I've also replicated the same oddity where it works when turning Design Mode on and back off, but when I start transmitting any type of data it does not work. I also tried using different bindings such as just the position by itself, no dice.