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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:00:14+00:00 2026-06-11T05:00:14+00:00

I have an ArrayList in which I add BigDecimals. My problem is, that the

  • 0

I have an ArrayList in which I add BigDecimals.

My problem is, that the BigDecimals use . and , the american way – and I want it the European way – e.g. instead of 14.70 I want 14,70.

I made a method:

public static String getLocale(BigDecimal n) {
   String newValue      =   null;
   if (n != null) 
      newValue  =   NumberFormat.getInstance().format(n);   
   return newValue;
}

Wherein when I print the entire ArrayList to a .csv I call this method for each of the Bigdecimals. However I was wondering if I can change the entire ArrayList to know, that I want to store elements the “correct” way for me? Or maybe to change the Locale when I set the BigDecimal into the ArrayList?

What is the best way to do this?

  • 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-11T05:00:16+00:00Added an answer on June 11, 2026 at 5:00 am

    The best way is the way you’ve done it, although I would name the method format() instead of getLocale(), since the method doesn’t get a Locale, but formats a BigDecimal.

    The data is a list of BigDecimals. Whether and how this data is displayed/stored in a CSV file shouldn’t change the nature of the data. If later, you need to display these data in a web page in English, you shouldn’t have to change the nature of the data, but only the way this data is displayed.

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

Sidebar

Related Questions

I have an arraylist in my metod receiveArrayLists which i want to add to
So I have this method which will take an ArrayList of Integers, I compare
I have an arraylist: Dim downloadsarray As New ArrayList downloadsarray.Add(iconlink) downloadsarray.Add(imgpath) downloadsarray.Add(filesize) downloadsarray.Add(description) Which
i have an arraylist and i want to add and remove many items at
I have an ArrayList and I want to copy it exactly. I use utility
I have to create a method which has an ArrayList; I need to remove
I have an ArrayList which I add some Objects to it dynamically, and I
I have a java ArrayList to which I add 5 objects. If I iterate
I have an ArrayList of strings that i need to modify. When i add
I currently have an arraylist in which I add blossom objects ( which fall

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.