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 6607897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:33:09+00:00 2026-05-25T19:33:09+00:00

In my app, I have edit text boxes where the user enters a decimal

  • 0

In my app, I have edit text boxes where the user enters a decimal value that the app uses to run a calculation.

Some users in other locales are reporting problems when entering the numbers, like entering a value and a different one appearing. I have tried to fix this by getting the value from the editText with this method:

public double stringToDouble(String s){
        if (nf == null){
            nf = NumberFormat.getInstance(Locale.US);
        }
        try {
            return nf.parse(s).doubleValue();
        } catch (ParseException e) {
            e.printStackTrace();
            return 0.0;
        }
    }

and

val = stringToDouble(et.getText().toString());

But apparently that still isn’t working for some people.

One user in Slovenia reported that it works fine if

  • settings; Language & keyboard :
  • Select language : set to English(Slovenia)
  • Touch input: set only to English and whatever language(my case
    Slovenia)
  • Bilingual prediction: OFF
  • Text prediction: OFF

What is the correct way to go about fetching the double values?
Thanks

  • 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-25T19:33:09+00:00Added an answer on May 25, 2026 at 7:33 pm

    From the looks of it, the correct way to do it is:

    public double stringToDouble(String s){
            if (nf == null){
                nf = NumberFormat.getInstance(Locale.getDefault());
            }
            try {
                return nf.parse(s).doubleValue();
            } catch (ParseException e) {
                e.printStackTrace();
                return 0.0;
            }
        }
    

    So far that seems to be working for me.

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

Sidebar

Related Questions

in my application I have 3 edit boxes where the user enters in text.
I have some edit boxes in my app, some of them I will input
I am trying to run jquery through a rails app. I have the edit
Im attempting to make a little app that lets you add text boxes to
I have a WPF app that uses an Entity Framework Model. One of the
I have a simple app that allows the user to push a button that
My App is crashing when I start this activity. I have an edit text
in my app i have two edit boxes for email and username. Whatever the
I have a button on my home screen that will add an edit text
I am making an app in which i have to use edit text and

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.