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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:36:35+00:00 2026-05-27T14:36:35+00:00

I am trying to parse string 0.0000 with double.TryParse() but I have no idea

  • 0

I am trying to parse string “0.0000” with double.TryParse() but I have no idea why would it return false in this particular example. When I pass integer-like strings e.g. “5” it parses correctly to value of 5 .

Any ideas why it is happening ?

  • 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-27T14:36:35+00:00Added an answer on May 27, 2026 at 2:36 pm

    it takes the localization settings at runtime into account… perhaps you are running this on a system where . is not the decimal point but , instead…

    In your specific case I assume you want a fixed culture regardless of the system you are running on with . as the decimal point:

    double.TryParse("0.0000", NumberStyles.Number, CultureInfo.CreateSpecificCulture ("en-US"), out temp)
    

    OR

    double.TryParse("0.0000", NumberStyles.Number,CultureInfo.InvariantCulture, out temp)
    

    Some MSDN reference links:

    • Double.TryParse(String, NumberStyles, IFormatProvider, Double)
    • CultureInfo.CreateSpecificCulture(String)
    • IFormatProvider Interface
    • CultureInfo.InvariantCulture Property
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse this string into java, but I keep getting errors. {id:1,jsonrpc:2.0,result:{limits:{end:3,start:0,total:3},sources:[{file:/media/storage/media/re
I'm trying to parse this XML string: <?xml version=1.0 encoding=UTF-8 standalone=no?> <response type=success> <lots>
I am trying to parse a string something like this: Input 20:00 - output
Im trying to parse the string located in /proc/stat in a linux filesystem using
I'm trying to parse a string that was generated by an NSDateFormatter using another
I'm trying to parse a string in a specific format and I'm really surprised
I am trying to parse a string of HTML tag attributes in php. There
Trying to parse an SQL string and pull out the parameters. Ex: select *
I'm trying to parse a simple string in C++. I know the string contains
I'm trying to parse an international datetime string similar to: 24-okt-08 21:09:06 CEST So

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.