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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:01:55+00:00 2026-06-17T05:01:55+00:00

I am trying to convert an item from a text box which contains double

  • 0

I am trying to convert an item from a text box which contains double numbers such as “1.1”. Is there a way in which I can format this, so that the “.1” will be removed and it can be assigned to the variable “points”?

Is there a way in which I can convert an item from the text box “txtTotal” which inside it will contain “1.1” to be formatted to hold the numbers before the point and then be assigned into the points variable, and points will then output “1”?

int points;

txtTotal.Text = string.Format("£{0:0}");
points = Convert.ToInt32(txtTotal.Text);
MessageBox.Show("{points}");

Thanks for the Help!

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

    You can try to Split the Text on the decimal point, then remove the £ from the first array index using TrimStart., and I would use int.TryParse to check if the output is valid.

    Like this:

    int points;
    txtTotal.Text = string.Format("£{0:0}",txtTotal.Text);
    if(int.TryParse((txtTotal.Text.Split('.')[0].TrimStart('£')),out points))
       MessageBox.Show(points.ToString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert text into xml format. And I'm using LXML Library. But
I'm trying convert all special chars into HTML safe entities on their way into
Trying to convert output from a rest_client GET to the characters that are represented
Trying to convert the following but am having difficulty. Can anyone see where I'm
im trying to convert a date format into a new format in this example
Working with Sitecore and Linq extensions. I am trying to convert to from an
I am trying to convert an existing process in a way that it supports
I'm trying to convert Twitter's created_at tag information from an XML file to a
I'm trying to create a function to read Morse code from one file, convert
I am trying to convert a pretty complicated JSON string with json2.js from json.org

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.