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 » Mon Jul 13, 2020 11:01 pm

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 9: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: 655
Joined: Mon Jun 02, 2014 2:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 18.04.4 LTS

Re: XML Exprssions: Round?  

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

Code: Select all
           <expression>
                <floor>
                    <sum>
                        <property>your/property/here</property>
                        <value>0.5</value>
                    </sum>
                </floor>
            </expression>
WoodSTokk
 
Posts: 540
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: XML Expressions: Round?

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

Thank you, that's a sneaky workaround :D
Last edited by dg-505 on Tue Jul 14, 2020 9: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: 655
Joined: Mon Jun 02, 2014 2:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 18.04.4 LTS

Re: XML Exprssions: Round?

Postby Johan G » Tue Jul 14, 2020 11:39 am

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)
Johan G
Moderator
 
Posts: 5781
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit


Return to Systems

Who is online

Users browsing this forum: No registered users and 1 guest