• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

XML Gauge rounding to nearest 10 unit

Messages
29
Country
unitedkingdom
This seems like it should be a simple piece of code but I can not figure it out at the moment. I would like to calculate the fuel quantity (already converted from gallons to lbs) to the nearest 10.

I already have this:
Code:
<String>
%((A:FUEL TANK CENTER2 QUANTITY, gallons) 6.7 * )%!4.0f!%
</String>

Which will return for example 1038, and I would like to read 1040.
 
You can try these.. Not sure why you are using the "f" print code if you want whole numbers.

This will print 4 digits with preceding zeros -
%((A:FUEL TANK CENTER2 QUANTITY, gallons) 6.7 * 10 / near 10 *)%!04d!%

This will print only the valid digits -
%((A:FUEL TANK CENTER2 QUANTITY, gallons) 6.7 * 10 / near 10 *)%!d!%
 
Last edited:
Back
Top