Solved

Parse a double

Posted on 2012-04-02
2
404 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now