Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6935273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:04:50+00:00 2026-05-27T12:04:50+00:00

I am getting a latitude value using forwardGeocoder and I am adding the obtained

  • 0

I am getting a latitude value using forwardGeocoder and I am adding the obtained latitude value with a decimal number. Have a look at the below code.

Ti.Geolocation.forwardGeocoder(textField.value, function(e) {
            var a = e.latitude;
            var b = 0.1;
            var c = a+b;
            Ti.API.info('result c:  '+c);
});

The result shows

[INFO] result c:  40.7145500.1

The problem is, the given value is not added to the latitude value, it is just printed along with the sting.

When I tried subtraction, it worked fine. When I tried using custom values for a and b, it worked fine.

Ti.Geolocation.forwardGeocoder(textField.value, function(e) {
            var a = 0.1;
            var b = 0.1;
            var c = a+b;
            Ti.API.info('result c:  '+c);
});

The result shows

[INFO] result c:  0.2

So, how could I add a number to the obtained latitude? Help me to solve this issue. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:04:51+00:00Added an answer on May 27, 2026 at 12:04 pm

    It looks like e.latitude is a string, and JavaScript is converting the Number to a string and concatenating it.

    Try this:

    Ti.Geolocation.forwardGeocoder(textField.value, function(e) {
                var a = parseFloat(e.latitude);
                var b = 0.1;
                var c = a+b;
                Ti.API.info('result c:  '+c);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have latitude and longitude defined as decimal(9, 6) in my zip code table,
Getting the above error in following code. How to rectify it. Thanks. Please look
This is my code to get current location using Geolocation property of HTML5, <!DOCTYPE
I have the following code: $stmt = $db->prepare(SELECT LATITUDE, LONGITUDE FROM NODEGEOLOCATION WHERE NODEID
Getting started with NHibernate How can I generate identity fields in nHibernate using Hilo
I need the correct way of getting latitude and longitude in Android programmatically. I
i'm looking for answer about getting latitude and longitude from uimapkit. there is same
This is a basically gps application where i am getting the latitude information from
I want to create an application which retrieves the latitude and longitude value of
I'm getting a strange error when assigning a value to one of my objects.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.