?
Solved

Decimal problem?

Posted on 2006-11-06
11
Medium Priority
?
1,339 Views
Last Modified: 2012-08-13
The following assignment generates a compilation error:

decimal accountBalance = 1550.30;

This code generates the error. "Literal of type double cannot be implicitly converted to type 'decimal';...". To avoid this error, which suffix would you append to the literal value?
0
Comment
Question by:mathieu_cupryk
[X]
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
  • 4
  • 4
  • 3
11 Comments
 
LVL 22

Expert Comment

by:_TAD_
ID: 17885027


if I am not mistaken, this should work....


decimal accountBalance = 1550.30m;

0
 
LVL 22

Expert Comment

by:_TAD_
ID: 17885028


if I am not mistaken, this should work....


decimal accountBalance = 1550.30m;

0
 
LVL 22

Expert Comment

by:_TAD_
ID: 17885029


if I am not mistaken, this should work....


decimal accountBalance = 1550.30m;

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Accepted Solution

by:
ozymandias earned 1000 total points
ID: 17885051
decimal accountBalance = 1550.30M;
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17885059
I think you need uppercase M.
TAD...you are posting everything 3 times dude.
0
 

Author Comment

by:mathieu_cupryk
ID: 17885088
It should be big M
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17885104
Is this a quiz ?
0
 

Author Comment

by:mathieu_cupryk
ID: 17885114
No I am helping a friend with some practice questions.



0
 

Author Comment

by:mathieu_cupryk
ID: 17885121
It is to help us improve.
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 17885279

Nope, it doesn't matter.

m and M work equally well.


...and I can't help the triple post.  sometimes it posts multiple times and sometimes it does not.  I think it may be the proxy server I'm going through.
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17885294
> m and M work equally well
Wow. I did not know that. Never tried it. I am a bit surprised actually.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

762 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