Solved

Parse a double

Posted on 2012-04-02
2
415 Views
Last Modified: 2012-04-02
Hi,

I try to parse a double.

            {
                btnSwUnit.Text = "Switch to mg/dl";
                lblSwUnit.Text = "Glucose Units: mmol/l";
                MessageBox.Show("Waardes als form opstart" + Properties.Settings.Default.IsMGDL);
                if (Double.TryParse(Properties.Settings.Default.MinVal, NumberStyles.Any, ci, out MinVal)) 
                this.spdMinVal.EditValue = MinVal.ToString();
                if (Double.TryParse(Properties.Settings.Default.MinRng, NumberStyles.Any, ci, out MinRng)) 
                this.spdMinRng.EditValue = MinRng.ToString();
                if (Double.TryParse(Properties.Settings.Default.MaxRng, NumberStyles.Any, ci, out MaxVal)) 
                this.spdMaxRng.EditValue = MaxRng.ToString();
                if (Decimal.TryParse(Properties.Settings.Default.MaxVal, NumberStyles.Any, ci, out MaxRng)) 
                this.spdMaxVal.EditValue = MaxVal.ToString(); 
            }

Open in new window


But I get this error:

The name 'NumberStyles' does not exist in the current context      

What can i do about this?

Greetings,

Peter Kiers
0
Comment
Question by:peterkiers
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 37797726
Just add a using to System.Globalization or change the code to say System.Globalization.NumberStyles.Any.
0
 
LVL 1

Author Closing Comment

by:peterkiers
ID: 37797743
Thanks. Peter
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question