# How to display a decimal number to 2 digits without round off

Posted by Chaithragm under C# on 11/26/2013 | Points: 10 | Views : 1671 | Status : [Member] | Replies : 6
i want to display a decimal numbers like

123.4567-->123.45 and not as 123.46
how to display the the decimal numbers without round off

#### Responses

Posted by: Allemahesh on: 11/26/2013 [Member] [MVP] Silver | Points: 25
 0 See the below example and you will get your output. ```string a = Convert.ToString("123.4567"); int i = a.IndexOf('.') + 3; string d = a.Substring(0, i); // Here d = 123.45``` Happy Coding, If it helps you or directs U towards the solution, MARK IT AS ANSWER Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Chaithragm on: 11/26/2013 [Member] Starter | Points: 25
 0 i want 123.45 as answer and not as 123.46 d=123.45 //i want this as the value of dChaithragm, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Allemahesh on: 11/26/2013 [Member] [MVP] Silver | Points: 25
 0 The above code will return the 123.45 and here once again code.`string a = Convert.ToString("123.4567");int i = a.IndexOf('.') + 3;string d = a.Substring(0, i); // Here d = 123.45` Happy Coding, If it helps you or directs U towards the solution, MARK IT AS ANSWER Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: vishalneeraj-24503 on: 11/26/2013 [Member] [MVP] Platinum | Points: 25
 0 Hi use below code:decimal i = 123.4567;int j = i.ToString("N2");N2 is used for displaying in 2 decimal places.Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Allemahesh on: 11/26/2013 [Member] [MVP] Silver | Points: 25