2 Replies Latest reply on Jan 26, 2017 1:26 AM by NBusch

    Localization error in GetAsNumber


      Product and version  FileMaker Advanced, Pro & Runtime 15 and 14

      OS and version Windows 10



      GetAsNumber() should always recognize the decimal delimiter in a given text, but fails to do so on a Swiss system


      I stumbled upon this when I tried to write the latitude and longitude as returned by the google maps API into number fields in Filemaker. Google returns a string like "42.456123", but writing this into a field of the type number drops the decimal point. Likewise GetAsNumber ("42.4567834") should yield the value 42.4567834, instead FileMaker returns 424567834. If you use the same function without quotes, GetAsNumber (42.4567834), the correct value is returned.


      How to replicate

      Before starting FileMaker, add the language "German (Switzerland)" to your system settings and set your number formats to use this. The settings look like this:


      Then check with GetAsNumber ("42.4567834")



      Workaround (if any)

        • 1. Re: Localization error in GetAsNumber

          OK, this is a bit more complicated. Apparently the decisive moment here is when you generate the file. Setting the data viewer to watch "GetAsNumber( "42.34567")" yields different results depending on which of the files that make up the solution is active. I will do more testing tomorrow and come back with the results.

          • 2. Re: Localization error in GetAsNumber

            So this is what we found: Where Getasnumber() is called to process a string like "42.123456" it will only recognize the decimal separator correctly if the format is the same that was set as system format at the time of file creation or cloning.


            A German system uses the format "4,123456". A file build on a German system will understand "42,123456" but not "42.123465" regardless of the current system settings. Vice versa a file build on a system using the point as decimal separatorw will only understand this format, but not the current system format.


            "Set Use System Format" doesn't help.