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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:04:15+00:00 2026-05-13T11:04:15+00:00

Java uses period in decimals, e.g. 1/2 = 0.5 Is there any way to

  • 0

Java uses period in decimals, e.g. 1/2 = 0.5

Is there any way to make it use comma instead, as in 1/2 = 0,5? And not to use comma for thousands (as in one hundred thousand = 100,000) but use space instead (100 000)?

When it comes to output I suppose I could use all sorts of string format functions, but the problem is input (JTable). Some columns require Double format so users must enter something like 45.5 and in these parts they are used to 45,5 🙂 Thanks in advance

Update:

I tried using myTable.setDefaultLocale(Locale.Germany); but it didnt work. I also did Locale.setDefault(Locale.Germany); @ main function and it did work but in rather silly way: while cell is in editing mode, you must enter dot as normal, i.e. 45.5 but after you hit enter to confirm changes, it is displayed as comma: 45,5. I mean it uses comma only for display purposes, but when editing its still same ol’ dot.

Is there any way to fix it without writing custom table model?

  • 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-13T11:04:15+00:00Added an answer on May 13, 2026 at 11:04 am

    Thus, you basically want to convert a localized String representation supposedly in a numerical format into a Number/BigDecimal and vice versa?

    There you have the java.text.DecimalFormat for. To learn more, consult Sun’s own tutorial about the subject.

    To localize your Swing application, use JComponent#setDefaultLocale(). E.g.

    JComponent.setDefaultLocale(Locale.GERMANY);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I heard C, C++, Java uses two complements for binary representation. Why not use
Is there a way to limit both the number of cores that java uses?
Because Java uses object references and not objects themselves, what prevents me from using
Why didn't python just use the traditional style of comments like C/C++/Java uses: /**
As we know Java uses erasure, so any Generic class cannot do T t
I have this and I want to use something similar to the way Java
MyClassWithMainMethod.java uses classes of someJar.jar. If I call: java -cp someJar.jar MyClassWithMainMethod I get
My Project has 2 java files (A.java and B.java in same package). A.java uses
My Java applications uses Hibernate with a SessionFactory-scoped interceptor in order to change data
My Android application uses Java OAuth library, found here for authorization on Twitter. I

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.