Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Operands of type 'decimal' and 'double'
WhatsApp
Venkatesan Jayakantham
12y
48.1
k
0
0
25
Blog
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
Up Next
Replace Double Quotes to Single Quotes in C#
Ebook Download
View all
The SOLID Principles
Read by 18.3k people
Download Now!
Learn
View all
Membership not found