3

I try:

 decimal dd = 4.12345611111111111; lblText.Text = string.Format("{0:N6}", dd); 

but I got a error use an M suffix

 decimal dd = 4.12345611111111111m; 

its work perfect.I want to know what is m for?.Thanks for clearing my vision.
note: lblText is id of label control in asp.net.

4 Answers 4

8

If you don't specify the suffix the default is double for a number with decimal separator. M specify that the literal is actually a decimal

Sign up to request clarification or add additional context in comments.

1 Comment

+1, but i did want to add some msdn documetnation: msdn.microsoft.com/en-us/library/364x0z75.aspx
2

It is a literal used for decimal type. Read more here

Comments

0

TO display decimal value you have to append m or M.

Comments

0
decimal d = 1.04893m; 

The m stands for monetary if I'm not mistaken, the f for float, and the d, surprisingly, for double.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.