Announcement

Collapse
No announcement yet.

Looking for some MySQL Code (Altitude to FL)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looking for some MySQL Code (Altitude to FL)

    Hi, with a percent chance of the low teens I'm looking for a way in MySQL code to report flight level from altitude. For the best part:

    concat("FL",left(altitude,3)) gets me what I need but when the altitude is reported as 40950 I'm really looking to round up to 41000 but can't seem to find a function for rounding up integer values.

    I'd appreciate any help, thanks.
    Michael
    Palmerston North,
    New Zealand
    ex-FR24 Feeder

  • #2
    It may only help if you using basic PHP to display the outputs like me..

    I just put in another column in mine to test, with the native PHP round function used to get a result. Which you could then concant also. By default it rounds to halves but there are other parameters

    ".Round($rows['altitude'],-3)."

    Ends in result:

    FLtest.jpg
    Posts not to be taken as official support representation - Just a helpful uploader who tinkers

    Comment


    • #3
      Thanks for the heads up on the PHP code, it may be a solution. I've currently got MySQL code:

      Code:
       left(round(max(altitude)/100,0),3)
      Michael
      Palmerston North,
      New Zealand
      ex-FR24 Feeder

      Comment


      • #4
        Yeah shortly after finding the PHP ver I noted a SQL ver of round. But wasn't sure how to impliment with our standard tables as such to get a new array field to play with
        Posts not to be taken as official support representation - Just a helpful uploader who tinkers

        Comment


        • #5
          Originally posted by nzradar View Post
          Thanks for the heads up on the PHP code, it may be a solution. I've currently got MySQL code:

          Code:
           left(round(max(altitude)/100,0),3)
          Hi Michael,
          how can i make for me some page like yours?

          Thanks very much.
          Regards,
          Last edited by Oblivian; 2016-03-31, 18:11.
          Regards,
          Miguel Teixeira
          FR24 T-LPPT1 Radar

          Comment

          Working...
          X