Solved

Error in a methode

Posted on 2012-03-20
3
442 Views
Last Modified: 2012-03-20
Hi,

I have this:

        private void edtVal1_CustomDisplayText_1(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            if (Properties.Settings.Default.IsMGDL)
            {
                edtVal1.Properties.Mask.EditMask = "d";
                edtVal1.Properties.DisplayFormat.FormatType = FormatType.Numeric;
                edtVal1.Properties.DisplayFormat.FormatString = "d";
                edtVal1.Properties.EditFormat.FormatType = FormatType.Numeric;
                edtVal1.Properties.EditFormat.FormatString = "d";
                edtVal1.Properties.MinValue = 70;
                edtVal1.Properties.MaxValue = 140;
                edtUnit1.EditValue = "mg/dl";
            }
            else
            {
                edtVal1.Properties.Mask.EditMask = "n1";
                edtVal1.Properties.DisplayFormat.FormatType = FormatType.Numeric;
                edtVal1.Properties.DisplayFormat.FormatString = "n1";
                edtVal1.Properties.EditFormat.FormatType = FormatType.Numeric;
                edtVal1.Properties.EditFormat.FormatString = "n1";
                 edtVal1.Properties.MinValue = 1.0; <==================
                   edtVal1.Properties.MaxValue = 35.0; <=====================
                edtUnit1.EditValue = "mmol/l";
            }
        }

Open in new window


I get an error at the 2 lines that I have marked with an arrow.

"Literal of type double cannot be implicitly converted to type 'decimal'; use an 'M' suffix to create a literal of this type"

What can I do about this to solve this?

Peter
0
Comment
Question by:peterkiers
3 Comments
 
LVL 18

Assisted Solution

by:Cluskitt
Cluskitt earned 100 total points
ID: 37741332
Use =1 and =35. Implicit conversion of a double to integer cannot be made as it would imply losing precision. You can also cast it with (int) 35.0.
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 400 total points
ID: 37741334
edtVal1.Properties.MinValue = 1.0M;
edtVal1.Properties.MaxValue = 35.0M;

or

edtVal1.Properties.MinValue = (decimal)1.0;
edtVal1.Properties.MaxValue =  (decimal)35.0M;
0
 
LVL 1

Author Comment

by:peterkiers
ID: 37741352
Thanks for the response.
It helped me alot.

Greetings,


Peter Kiers
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

19 Experts available now in Live!

Get 1:1 Help Now