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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:07:45+00:00 2026-05-15T21:07:45+00:00

In my application, I have a TextBlock that I display a Double number in

  • 0

In my application, I have a TextBlock that I display a Double number in after the user presses a button. This number can be a very small decimal or a very large number needing exponential notation (i.e. 3.43e12). The problem is, the program prints so many digits that it overflows my TextBlock and the user can’t see all the valid information.

So how can I restrict the Double to print so to not overflow the TextBlock?

The code I am using to set the text is:

theTextBox.Text = (split * input).ToString();

EDIT: Someone asked for specific examples, so I thought I would clarify something. I basically want the string to never be longer than, say, 10 characters. That way it will fit in the TextBlock. I guess the trick is, when should those 10 characters be decimal places, whole numbers, or scientific notation that is the trick…

  • 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-15T21:07:46+00:00Added an answer on May 15, 2026 at 9:07 pm

    Use Double.ToString(String), giving an appropriate format specifier, as described at http://msdn.microsoft.com/en-us/library/kfsatb94.aspx.

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

Sidebar

Related Questions

Basically I have a WPF application that will display announcements to the user within
I have application that is up more than 3 days. I can see in
I have a small WPF application that I am working on localizing. I have
In my WPF Application I have an GridViewColumn that looks like this: <GridViewColumn Width=170>
I have a style for a textblock that is set inside my app.xaml this
I have a wpf application and in that application i have a button and
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have a VB.net WPF application that creates a list from a databind. For
I have a window in one assembly that has a TextBlock control that 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.