Graphics

 View Only
  • 1.  Visual Logic Math

    Posted 12-21-2016 19:42

    I am using visual logic to calculate stat percentages for basketball. Currently I am using visual logic to pull data from the Stat Crew XML file. The problem I have having is that in order to display 56.7% I am multiplying by 100% and it does not round correctly when the PA Announcer reads the stats from the stat sheet he gets. When I multiply by 1 and increase the String value to 5 I get the correct rounded percentage, but as 0.568%. Is there anyway that I can have this read 56.8%?



  • 2.  RE: Visual Logic Math

    Posted 12-21-2016 20:25
    Ran into a similar problem. I worked around it by delimiting the text to essentially get 56 and 8 as separate tabs and writing VL to keep them equal on X-plane. I know when I was using stat crew and XPression, we just used the .568 number. It certianly doesn't look as clean but was easier than doing what I did. Maybe someone here has a better solution.
    #XPression


  • 3.  RE: Visual Logic Math

    Posted 12-22-2016 01:21
    I would suggest instead of using the "LeftString 4" block, use the Format Float block set to 1 decimal place of precision. This will round the number accurate to 1 decimal instead of just truncating like your LeftString block is doing.
    #XPression


  • 4.  RE: Visual Logic Math

    Posted 12-22-2016 02:06

    Example: 


    #XPression