Solved

Parse a double

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…

831 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