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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:05:05+00:00 2026-06-18T05:05:05+00:00

Recently new job and got a question regarding an error in the software from

  • 0

Recently new job and got a question regarding an error in the software from a customer. The error is “Conversion from string ‘0.5’ to type ‘double’ is not valid.”

I believe I have found the offending line. Because the customer is in France and has his computers settings all in french (numbering system, language,…) that the “0.5” can’t be casted to french number version of “0,5” The French system has no decimals anywhere in their numbers. So, if string.format sees “0.5” it won’t know what to do, because there is no ‘.’ character to be casted to double in french culture settings. Am I right here?

context.Append(String.Format("{0} {1} exceeds fine {2} limit of {3:N0}", _
       context.OccupancyState, context.Size, _
       Reg.Alert.ToLower, context.Limit))

Where context.Size holds the “0.5” string.

Does format.string take into account the culture settings, or am I missing something here?

EDIT:

Just tried it on french windows VM, and (unfortunately) it was able to parse it as “0,5” successfully…So maybe that isn’t the problem?

  • 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-18T05:05:07+00:00Added an answer on June 18, 2026 at 5:05 am

    You need to convert the string to a double first, otherwise String.Format will just concat the string without any formatting.

    double d = double.Parse(context.Size, CultureInfo.InvariantCulture);
    string formatted = String.Format("{0} {1} exceeds fine {2} limit of {3:N0}"
                                     , context.OccupancyState, context.Size
                                     , Reg.Alert.ToLower, context.Limit);
    

    Now string.Format will use System.Globalization.CultureInfo.CurrentCulture when it formats the double to a string again.

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

Sidebar

Related Questions

I recently made the switch to a new job and consequently the switch from
Recently got a new job as a Rails developer, having never previously used the
I started a new job recently. I've been a Java & XML web developer
I have recently started a new job and noticed that all the SQL tables
Iv'e recently started a new job as an ICT Technician and im creating an
I'm using quartz 1.6.5. I recently moved from Quartz Job Store from RamJobStore to
I recently started a new job where the office environment is Mac-based, but I
HI all. I have started a new job recently where I am supposed to
I've recently started a new job wherein I have to fix bugs with and
I have recently started a new job, and the company uses Visual SourceSafe for

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.