Page 1 of 1

FIP - issue with TextFormat

Posted: 19 Feb 2019, 21:47
by lechevbt
Hi all, hi c0nnex,

I'm programming a FIP with Spad.neXt and try to use the TextFormat command so as to handle number of decimals in my display.
But each trial result in a "ERROR" text displayed instead of my value. Below is a test example. First element displays "0,85" as expected (no formatting), the following two (with <TextFormat>{0:F1}</TextFormat> command) displays ERROR. In attachment is a view of the display I get.

Can anyone help me understand where I'm making a mistake ? I also tried {0:G1}, {0:G1}

Benoit

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<Gauge Name="Benoit: Test" Version="1.0">

<Element>
		<Label FontStyle="Bold" FontSize="48">
			<TextExpression>(T:XPLANE:sim/flightmodel/engine/ENGN_oil_quan:0)</TextExpression>
			<Position X="20" Y="13" />
			<Size X="250" Y="71" />			
			<Color Background="Transparent" Foreground="White" />
		</Label>
</Element>
<Element>
		<Label FontStyle="Bold" FontSize="48">
			<TextExpression>(T:XPLANE:sim/flightmodel/engine/ENGN_oil_quan:0) </TextExpression>
			<TextFormat>{0:F1}</TextFormat>
			<Position X="20" Y="83" />
			<Size X="250" Y="71" />			
			<Color Background="Transparent" Foreground="White" />
		</Label>
</Element>
<Element id="mybackground">
		<Label FontStyle="Bold" FontSize="48">
			<TextExpression>(T:XPLANE:sim/flightmodel/engine/ENGN_oil_quan:0) </TextExpression>
			<TextFormat HorizontalAlignment="Far">{0:F1}</TextFormat>
			<Position X="20" Y="150" />
			<Size X="250" Y="71" />
			<Color Background="Transparent" Foreground="White" />
		</Label>
</Element>

<GaugeSettings PowerMode="Default" GaugeCompatibility="SPAD">
  <Author>xxx</Author>
  <Description>Test</Description>
  <Type>Airliner</Type>
</GaugeSettings>
</Gauge>

Re: FIP - issue with TextFormat

Posted: 15 Mar 2019, 18:56
by c0nnex
just use

Code: Select all

<TextFormat HorizontalAlignment="Far">F1</TextFormat>
SPAD.Next adds the "{0:" and "}" itself.