SPAD.neXt 0.9.6.50 has been released to public

FIP - issue with TextFormat

General Discussions
Locked
lechevbt
Passenger
Posts: 3
Joined: 14 Aug 2016, 22:27
Status: Offline

FIP - issue with TextFormat

Post by lechevbt » 19 Feb 2019, 21:47

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>
You do not have the required permissions to view the files attached to this post.

User avatar
c0nnex
Site Admin
Posts: 4855
Joined: 10 Mar 2015, 21:52
Location: Munich, Germany
Contact:
Status: Offline

Re: FIP - issue with TextFormat

Post by c0nnex » 15 Mar 2019, 18:56

just use

Code: Select all

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

Locked