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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:49:24+00:00 2026-05-27T19:49:24+00:00

My app is working on many devices without problems so far. But now I

  • 0

My app is working on many devices without problems so far. But now I got my new Galaxy Tab with Android 3.2 where it crashes all the time. I found out that the problem was a float in an EditText.
I am using myEditText.setText(String.format("%.1f", fMyFloat)); to put the float in the EditText. But somehow the float on my 3.2 Galaxy Tab is generated with a comma instead of a point. When I read the EditText back the app crashes of course, telling me that this is no valid float because of the comma…

What is going wrong here?

  • 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-27T19:49:24+00:00Added an answer on May 27, 2026 at 7:49 pm

    Convert float to string..

    From the documentation of String.format:

    String.format(String format, Object… args)

    Returns a localized formatted string, using the supplied format and arguments, using the user’s default locale.

    The quoted text above means that the output of String.format will match the default locale the user uses.

    As an example a comma would be used as the decimal-point-delimiter if it’s a user using Swedish locale, but a dot if it’s using an American.

    If you’d like to force what locale is going to be used, use the overload of String.format that accepts three parameters:

    • String.format (Locale locale, String format, Object… args)

    Convert string to float..

    Parsing an arbitrary string into a float using the default locale is quite easy, all you need to do is to use DecimalFormat.parse.

    Then use .parse to get a Number and call floatValue on this returned object.

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

Sidebar

Related Questions

I have a vb app working now but many users have complained to me
I'm currently working on a project that's based on Android. Without getting into many
I'm implementing ShareKit in my app. Everything is working fine, but there are many
I am working on a CPU-heavy numerical computation app. Without going into many details,
The app I'm working on has 4 tabs, 3 of which share many features,
I've got a nice little web app working that brings down playlists and videos
I'm currently working on converting an Android app I built natively as an iPhone
I'm new to apple's development scene and have been working on an app for
I'm working on implanting Facebook in my app. Now I didn't put the Hash
I'm working on an app that, from the Main.mxml, opens one or many Window.mxml

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.