Heretic
Resource contributor
- Messages
- 6,830
- Country

I'm working with FS9 gauge syntax in FSX.
The bit of code below is supposed to provide the evaluation result in a green colored number when it is positive and in red for a negative result.
Positive results work well, but negative results return something akin of 10000 minus [evaluation result] in green.
Any ideas?
- Edit:
Made a mistake while calculating (L:Total Income,number). It was always much larger than (L:Total Cost,number), but I didn't notice that due to a faulty floating point display configuration.
The code works fine as posted.
The bit of code below is supposed to provide the evaluation result in a green colored number when it is positive and in red for a negative result.
Code:
<FormattedText X="35" Y="20" Length="50" Font="Arial" FontSize="14" Adjust="Right" VerticalAdjust="Top" Color="%((L:Total Income,number) (L:Total Cost,number) - 0 > if{ 'limegreen' } els{ 'red' })" Multiline="No" Bright="Yes">
<String>%((L:Total Income,number) (L:Total Cost,number) -)%!4.1f!</String>
Positive results work well, but negative results return something akin of 10000 minus [evaluation result] in green.
Any ideas?
- Edit:
Made a mistake while calculating (L:Total Income,number). It was always much larger than (L:Total Cost,number), but I didn't notice that due to a faulty floating point display configuration.
The code works fine as posted.
Last edited: