I am looking for an "Expression Operator" to convert a string value to its reciprocal. I have made a gauge to display the fuel to air ratio for the mixture using the parameter A:Recip Mixture Ratio, and it displays the ratio as 0.0856:1 (as an example), but I want to convert it to the equivalent ratio for air to fuel, which in this case would be 11.68:1. This, to me at least, is an easier number to get your head around. I can't find an operator that will do this amongst the ones listed in various tutorials etc.
The gauge coding is:
<Image Name="Mix Ratio Bkg.bmp" ImageSizes="100,20"
Luminous="Yes"/>
<Element>
<Position X="3" Y="4"/>
<Text X="45" Y="12" Length="22" Font="Arial" FontSize="12"
Color="#EBEBEB"
BackgroundColor="Black" Adjust="Left" VerticalAdjust="Center"
Luminous="Yes">
<String>Fuel/Air</String>
</Text>
</Element>
<Element>
<Visible>(A:Electrical Master Battery, bool) 1 == </Visible>
<Visible>(A:Circuit Avionics On, bool)</Visible>
<Position X="48" Y="4"/>
<Text X="48" Y="12" Bright="Yes" Length="10" Font="Arial"
FontSize="12" Color="0x55D9FF"
BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center">
<String>%((A:Recip Mixture Ratio:1, ratio))%!6.4f!:1</String>
</Text>
</Element>
</Gauge>
I need a conversion expression in the string to give me the reciprocal of the standard FS mixture ratio.


Reply With Quote
Bookmarks