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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:26:18+00:00 2026-06-09T13:26:18+00:00

I am at the beginning of a steep learning curve with Vc++ (C++/CLI) How

  • 0

I am at the beginning of a steep learning curve with Vc++ (C++/CLI)

How do you format text (numbers) in a text box on a form?

printf() was easy, in the good old days 😉

The following works but there are lots of decimal places.

I only need to display one decimal point.

that is 22.4 not 22.4178301

//Calculate the Power and current

fPower2 = (pow((fVoltagePkPk * 0.5 * 0.707),2) / 2);

fCurrent2 = fPower2 / (fVoltagePkPk * 0.5 * 0.707);



//Display the Power amd current in the text boxes

txtPower2->Text = Convert::ToString(fPower2);

txtCurrent2->Text = Convert::ToString(fCurrent2);

Thanks

  • 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-09T13:26:20+00:00Added an answer on June 9, 2026 at 1:26 pm

    You can use

    fPower2.ToString("F1")
    fCurrent2.ToString("F1")
    

    The F1 refers to 1 fixed digit. See http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx#Y2205 for more formatting options.

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

Sidebar

Related Questions

So, I'm just beginning to understand Regular Expressions and I've found the learning curve
The learning curve for iPhone development has been less steep than I expected. After
I am beginning Facebook App development and am following the Recipe Box App Tutorial
I'm studying simple machine learning algorithms, beginning with a simple gradient descent, but I've
I'm beginning one of my first C# projects--need to find the curve fit for
Since beginning to use VB.NET some years ago I have become slowly familiar with
I'm beginning a large scale javascript application with Marionette. A Marionette application has a
I am a beginning at nhibernate and I am trying to connect to a
I was beginning to write a bubble sort for this when I thought maybe
I'm beginning a computer vision project and I need to compute the horizontal and

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.