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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:42:08+00:00 2026-05-27T00:42:08+00:00

i have an array, a double array like… Double my_array = new Double[] {6272640.0,

  • 0

i have an array, a double array like…

Double my_array = new Double[] {6272640.0, 43560.0, 4840.0, 0.0015625, 4046856422.400000095, 40468564.223999999, 4046.856422400, 0.004046856, 1.0, 0.404685642};

and in my program i want to multiply each of that elements with some integer values…
which i accept through a variable n.

i had done it in my program as…

for(int 1=0;i<my_array.length;i++)
{
my_array[i] = n*my_array[i];
}

when i try to print the result, i gets value as exponentials…
like, 3.23E etc etc……

I need the result as double value up to 8 decimal points…

What should i do to get it

  • 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-27T00:42:08+00:00Added an answer on May 27, 2026 at 12:42 am

    I had changed my double array to String array, like

    String my_array[];
    my_array = new String[] {"1.006944444","6.45160645160", "0.00000326701", "0.0076001595"};
    
    // then used my for loop like
    
    BigDecimal b1 = new BigDecimal(n);
    for(int 1=0;i<my_array.length;i++)
    {
    BigDecimal b2 = new BigDecimal(Double.parseDouble(my_array[i]));
    BigDecimal result = b1.multiply(b2);
    System.out.println(result.doubleValue);
    }
    

    just check it yourself. as i had just described the logic, my for loop had much more to do..

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

Sidebar

Related Questions

I have an array of a few million numbers. double* const data = new
In my class, I have a method that returns an array like this. double
I have a 1 x N double array and I would like to merge
I have an array of double pointers, but every time I try do print
I have an double array alist[1][1]=-1 alist2=[] for x in xrange(10): alist2.append(alist[x]) alist2[1][1]=15 print
In my program I have one array with 25 double values 0.04 When I
Let's say I have an array of lots of values (C++ syntax, sorry): vector<double>
I'm looking to slice a two dimensional array in C#. I have double[2,2] prices
I have my own array class template I would like to optionally add functionality
I have an array of custom hooks I'd like to schedule, built along these

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.