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

  • Home
  • SEARCH
  • 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 8231157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:23:15+00:00 2026-06-07T17:23:15+00:00

//Show the current coordinates (Convert to String and round off – 6 decimal places)

  • 0
            //Show the current coordinates (Convert to String and round off - 6 decimal places)
        String printLat = new DecimalFormat("0.######").format((double)currentLat);
        String printLon = new DecimalFormat("0.######").format((double)currentLon);

        AlertDialog alert = new AlertDialog.Builder(Main.this).create();
        alert.setTitle("Current Location:");
        alert.setMessage("Latitude: " + printLat+ "\n" + "Longitude: " + printLon);
        alert.setButton("Close", new DialogInterface.OnClickListener()
        {               
            public void onClick(DialogInterface arg0, int arg1)
            {
                // TODO Auto-generated method stub
                //Alert Dialog won't work without a listener
                //Do nothing (This will simply close your alert dialog)
            }
        });     
        alert.show();

Here’s a part of my main class.

I should obtain what I am sending from my emulator. But instead of retrieving exact values, I’m getting this:

Latitude – 14.069315
Longitude – 121.323738

but I sent this (from my Emulator Control)
Latitude – 14.069316
Longitude – 121.323739

It’s just a matter of one decimal number, and a small value, but I’m worried if this will take a big effect of what will appear on my application, because I will use these values to add markers on my Google Maps.

Any suggestions?

  • 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-06-07T17:23:17+00:00Added an answer on June 7, 2026 at 5:23 pm

    This sounds like rounding error to me.

    I wouldn’t worry about this amount of error, as the number at the sixth decimal place equates to less than 1 meter on the ground (depending what latitude the location is at).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying for quite some time to show the current coordinates of
I'm new to Android. I want to create a widget which will show current
I know that you can show current GPS moving location on map with WP7
i'd like to use a seekbar to show the current value and adjust the
With the MKMapView there's an option called Show users current location which will automatically
I want to design a splash screen that can show the current loading process
I recently added these lines to my ~/.bashrc file to show the current branch
My current code uploads image successfully but still it does not show Toast message
i have created an application which show data from user current location. I want
For example, if the current user is admin, the Admin button will show. How

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.