Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 4535 |  Welcome, Guest!   Register  Login
 Home > Blogs > C# > Operator cannot be applied to operands of type 'decimal' and 'double' ...
Jvprabhusanthi

Operator cannot be applied to operands of type 'decimal' and 'double'

 Blog author: Jvprabhusanthi | Posted on: 5/3/2012 | Category: C# Blogs | Views: 898 | Status: [Member] | Points: 75 | Alert Moderator   


Once I tried to compare my string with the a decimal value. I got an error indicating the decimal value cannot be compared.

(Convert.ToInt(txt_LowerBound.Text) < 0.001))... Resolved by changing the conversion 
(Convert.ToDecimal(txt_LowerBound.Text) < 0.001)) 
  
Now, I got the next error message. 

Operator '<' cannot be applied to operands of type decimal' and 'double' 

The final change to get this condition work is as below, 

(Convert.ToDecimal(txt_LowerBound.Text) < 0.001M))

Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech



Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech
http://kaashivinfotech.com/Ebooks.aspx
Found interesting? Add this to:


Experience:9 year(s)
Home page:http://www.dotnetfunda.com
Member since:Tuesday, May 01, 2012
Level:Starter
Status: [Member]
Biography:
>> Write Response - Respond to this post and get points

More Blogs

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 1:37:52 PM