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

  • Home
  • SEARCH
  • 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 8095357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:06:07+00:00 2026-06-05T21:06:07+00:00

I have given a default value 2.5 for a textbox called diff_Box and then

  • 0

I have given a default value “2.5” for a textbox called “diff_Box” and then in order to check something in another purpose, I took this value and paste it into another textbox called “textbox5”. But in textbox5 it is displayed as 25. I know it is a very common issue but I can not solve it somehow. I have tried sofar;

double diff;

diff = Double.parse(diff_Box.Text);
diff = Convert.ToDouble(diff_Box.Text);



textBox5.Text = Convert.ToString(diff);
textBox5.Text = diff.ToString("F2");
textBox5.Text = ToString.parse(diff);

but I am encountering all the time the same problem

thanks in advance

enter image description here

enter image description 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-06-05T21:06:08+00:00Added an answer on June 5, 2026 at 9:06 pm

    The problem is that you are not using the format used by your system UI culture. You actually are using the InvariantCulture on your GUI.

    You use a . in the textbox. I assume your current UI culture uses ,. Therefore it sees no digits after the . and results in 25.0 instead of 2.5.

    This line will convert back using the InvariantCulture instead of the system UI culture:

    double diff = Double.Parse(diff_Box.text, CultureInfo.InvariantCulture);
    

    The better approach however is to use a private Double _diff and just convert it to the required culture for display on the form. Second, you should expect the users to use the UI culture for data-entry.

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

Sidebar

Related Questions

I have a non-nullable database column which has a default value set. When inserting
If I want a method that returns the default value of a given type
I have an application layout in my rails app to give a default header/footer
I have given 100% width to input box to fix to the browser width
i have given required permission : <uses-permission android:name=android.permission.WRITE_EXTERNAL_STORAGE /> hard-coded the path as /sdcard/filename
I have given bg image for radio button. It is working in chrome but
I have given client's queue connection details to connect to it using Camel. While
I have given a table background image using css background-image property. The cells are
Note: I have given up on compiling iPhone Apps without a developer certificate for
My boss have given me assignment to find how a web based application developed

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.