• Resolved supernova42

    (@supernova42)


    I’m using Decimal Fields for Latitude and Longitude values in order to plot them on a google map. Firstly, decimal fields in Participants Database have a 4 decimal point precision. In order that I have very precise latitude and longitude values can this be increased to 6 decimal places?

    Secondly my latitude entry must be from [-90º to +90º] and my Longitude entry must be from [-180º to +180º]. Is there anyway I can validate these values?

    Many Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xnau webdesign

    (@xnau)

    You can change the precision of the decimal field by editing the field datatype in the database directly using phpMyAdmin. This post discusses setting up the datatype: https://xnau.com/setting-up-a-currency-or-other-decimal-type-field/

    You can enforce limits on the field values by adding “min” and “max” limits. You do this in the field definition in the values parameter…something like:

    min::-90,max::90

    Take a look at the specs for HTML5 number input fields for the details on what attributes are available.

    Thread Starter supernova42

    (@supernova42)

    Thanks Roland – did both of these and all works fine now.
    I have many members in my boat owners website. They put details of their boat on the website together with the latitude and longitude of where the boat is kept. I use these values to show placemarkings on a google map for each of the boats so that the distribution of boats throughout the world is shown. It looks very impressive.
    Many Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Decimal Fields’ is closed to new replies.