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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:15:41+00:00 2026-05-13T12:15:41+00:00

This line of code: Console.WriteLine(Convert.ToInt32(23,23) + 1); Throws an exception. This line of code:

  • 0

This line of code:

Console.WriteLine(Convert.ToInt32(“23,23”) + 1);

Throws an exception.
This line of code:

Console.WriteLine(Convert.ToDouble(“23,23”) + 1);

Prints 2324.

Does anybody know why this is the case? I wouldn’t think that anything good could come of the second conversion.

  • 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-13T12:15:41+00:00Added an answer on May 13, 2026 at 12:15 pm

    From the MSDN documentation of System.Double.Parse:

    The s parameter can contain […] a string of the form:

    [ws][sign][integral-digits[,]]integral-digits[.[fractional-digits]][e[sign]exponential-digits][ws]

    Here, the comma (,) stands for “[a] culture-specific thousands separator symbol”.

    To summarize: If your current culture’s thousands separator symbol appears anywhere in the string, it is ignored by Double.Parse (which is invoked internally by Convert.ToDouble).


    Int32.Parse(string), on the other hand, does not allow thousands separators in the string:

    [ws][sign]digits[ws]
    

    which is why your first example throws an exception. You can change this behavior for both Double.Parse and Int32.Parse by using an overload that allows you to specify NumberStyles, as explained by the other answers.

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

Sidebar

Related Questions

Currently I have data in a string with via this line of code Console.WriteLine(TemplateMemoryBuilder.ToString());
I know that this line of code will make the cell text-wrap: $objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setWrapText(true); 'D1'
I have this line of code but it throws an error. What is the
This line of code: DateTime dt = DateTime.ParseExact(time, hh:mm, CultureInfo.InvariantCulture); parses a time value
This line of code ((Matches)Container.DataItem).MatchID works in C# but in VB.NET, when used in
This line of code is a snippet from my select statement. frdFreedays - DateDiff(dd,conReceiptToStock,GetDate())
Got this line of code here but its not working. private void Button_Click(object sender,
i use this line of code : [self parseXMLFileAtURL:url]; And i get this error
For some reason this line of code is giving me quite a problem. struct
I found this line of code in some code I'm analyzing: Mintau = (double*)

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.