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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:06:32+00:00 2026-05-22T23:06:32+00:00

Yeah I know it’s hard to believe – bug in .NET? But run this

  • 0

Yeah I know it’s hard to believe – bug in .NET? But run this code in the command line app:

decimal x;

x = decimal.Parse("3.E-2", NumberStyles.Float);
Console.WriteLine(x);

x = decimal.Parse("5.72e9", NumberStyles.Float);
Console.WriteLine(x);

x = decimal.Parse("3.E−2", NumberStyles.Float);
Console.WriteLine(x);

I’m getting exception during the last parse. Saying:

System.FormatException : Input string was not in a correct format.

The value for the first and last parse are exactly the same. Tested on two different x64 machines compiled toward .NET 3.5 and 4.

Any idea what is going on? Any work-around?

  • 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-22T23:06:33+00:00Added an answer on May 22, 2026 at 11:06 pm

    The first and 3rd are not exactly the same.

    in the 3rd you have a “longer” – sign, as a result it doesnt know what to do with it. Therefore you would need to check for that and replace it with the standard minus sign

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

Sidebar

Related Questions

Not this again I hear you say. Yeah, I know. But this one is
Yeah, its a bit on this side of pointless, but I was wondering... I've
Yeah this works in FF and Chrome, but for some reason wont work in
Yeah I know that SQL Server has got free express editions(2005/2008) But what i
Yeah I know ... Some people are sometimes hard to convince of what sounds
Yeah, I know is obsolete and old and everything you all might say... But
I have an iframe with designMode=on (Yeah - I know this is bad thing)
Yeah, so everyone knows WeatherBug, right? They have this URL... http://[apicode].api.wxbug.net/weatherservice.asmx Works great, but
I know I can just use an image for this but who in their
I know this is really easy and I'm looking over something but this is

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.