Current SPAD.neXt Release: 0.9.12.123

This forum has closed. Please join our Discord Community.

SPAD.neXt online services are no longer available for SPAD.neXt Versions < 0.9.11.5

FIP - issue with TextFormat

General Discussions
Locked
lechevbt
Flight Attendant
Posts: 10
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>
Attachments
FIP_Error.png
FIP_Error.png (43.92 KiB) Viewed 499 times

User avatar
c0nnex
Site Admin
Posts: 5469
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