How to display two decimal value if we enter any value it must come two decimal value only

Posted by Jitendrasoft09 under C# on 6/26/2013 | Points: 10 | Views : 619 | Status : [Member] [MVP] | Replies : 2
Hi All,
I want to understand How to display two decimal value if we enter any value it must come two decimal value only, let me know if anybody knows.
100.234- 100.23
100- 100.00
100.4- 100.40

Jitendra Kumar
If my post helps you, plz mark as an answer.



Responses

Posted by: lakhansin-22735 on: 6/27/2013 [Member] Starter | Points: 25

Up
0
Down
Are you talking about converting number to string:


// just two decimal places

String.Format("{0:0.00}", 123.4567); // "123.46"



Lakhan Singh
Tech Lead
BeyondKey System Pvt. Ltd.
Indore, M.P.
India

Jitendrasoft09, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bageshkumarbagi on: 6/27/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Refer This Link.
http://stackoverflow.com/questions/6951335/using-string-format-to-show-decimal-upto-2-places-or-simple-integer

Thanks,
Bagesh Kumar Singh

Thanks,
Bagesh Kumar Singh
Mark as answer if you have been satisfied

Jitendrasoft09, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response