Skip to main content
Community site session details

Community site session details

Session Id : qo3ziv1pTwaI2mKIFveQ0b
Power Apps - Building Power Apps
Unanswered

The value cannot be converted to a number on mobile

Like (0) ShareShare
ReportReport
Posted on 20 May 2024 10:53:49 by 510

Hi. This works perfectly on desktop but not on mobile. Please assist.

I have a SharePoint list with a Longitude and a Latitude column. They are both Number format.

I am getting current location from a map component.

I am patching the location using these formulas:

 

field_1: Value(Text(Substitute(Location.Latitude,",","."),"0.00000")),
field_2: Value(Text(Substitute(Location.Longitude,",","."),"0.00000"))

 

On mobile, I get this error when patching:

rwittels_0-1716202468774.png

 

Categories:
  • Prabhakar_S Profile Picture
    735 Moderator on 20 May 2024 at 13:21:11
    Re: The value cannot be converted to a number on mobile

    Hi @rwittels ,

     

    The error you're encountering on mobile devices may be due to regional settings or locale differences between the desktop and mobile environments. These differences can affect how numbers are interpreted, particularly when it comes to decimal separators. On mobile devices, the decimal separator might be interpreted differently (e.g., using a comma instead of a period).

     

    To ensure consistency and avoid regional settings issues, you can use the 'Text' function with the 'InvariantLanguage' option, which ensures that the number formatting is consistent regardless of the device's locale.

     

    Use the 'Text' function with 'InvariantLanguage' for consistent formatting:
    - For 'field_1' (Latitude):

    field_1: Value(Text(Location.Latitude, "[$-en-US]0.00000"))

    - For 'field_2' (Longitude):

    field_2: Value(Text(Location.Longitude, "[$-en-US]0.00000"))

     

    This ensures that the latitude is converted to a text string with a period as the decimal separator, formatted to 5 decimal places, using US number formatting. By using the '[$-en-US]' locale code, you force the 'Text' function to use the period as the decimal separator, which should be recognized correctly by the 'Value' function regardless of the device's locale settings. 

     

    Thanks!!!

     

    Please consider marking my response as the accepted solution if it successfully resolves your concern. If you found the information beneficial in other aspects, kindly express your appreciation by giving it a thumbs-up.

     

     

  • rwittels Profile Picture
    510 on 20 May 2024 at 11:02:49
    Re: The value cannot be converted to a number on mobile

    I tried to patch just the Location.Latitude and Location.Longitude and it works. I had an issue a while ago where I had to replace commas in the values with points but that doesn't seem to be happening anymore.

    I would appreciate some input here anyway.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete