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

Error in a methode

Posted on 2012-03-20
3
446 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
REXEX help Part 2 2 39
Sort GridView by ID Descending 1 17
Amazon S3 Images with .Net 3 15
Why use this lambda? 12 37
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…
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…

829 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