Board index FlightGear Development Aircraft Systems

XML Expressions: Round?  Topic is solved

Modeling aircraft systems, like electrical stuff, hydraulics, pneumatics? Feel free to ask support.

XML Expressions: Round?

Postby dg-505 » Tue Jul 14, 2020 12:01 am

Hello together, i've got a question:

Do the SGExpressions support rounding to e.g. the next integer number?
Or does another way exist to do roundings in Expressions?

Thanks in advance
Jonathan :wink:

Edit:
If this posting is inappropriate in this subforum, pease feel free to move it to a more suitable subforum....
Last edited by dg-505 on Tue Jul 14, 2020 10:00 pm, edited 1 time in total.
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: XML Exprssions: Round?  

Postby WoodSTokk » Tue Jul 14, 2020 2:54 am

Code: Select all
           <expression>
                <floor>
                    <sum>
                        <property>your/property/here</property>
                        <value>0.5</value>
                    </sum>
                </floor>
            </expression>
WoodSTokk
 
Posts: 1077
Joined: Tue Oct 17, 2017 3:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: SX-W57
IRC name: WoodSTokk
Version: 2020.4.0
OS: Debian Bullseye

Re: XML Expressions: Round?

Postby dg-505 » Tue Jul 14, 2020 9:16 am

Thank you, that's a sneaky workaround :D
Last edited by dg-505 on Tue Jul 14, 2020 10:00 pm, edited 1 time in total.
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: XML Exprssions: Round?

Postby Johan G » Tue Jul 14, 2020 12:39 pm

That is worth mentioning on the wiki. ;)

Edit: Added to the wiki (diff).
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6634
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit


Return to Systems

Who is online

Users browsing this forum: No registered users and 1 guest