Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Parse a double

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

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…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 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