Click here to Skip to main content
15,916,318 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want change a large number value store in double variable like 123.3425231134 to 123.34 and get it print to text box
Posted
Updated 9-Sep-15 23:54pm
v3
Comments
Leo Chapiro 10-Sep-15 5:54am    
And what was the problem?

1 solution

You can do this with string.Format:
C#
var mytext = string.Format("{0:0,00}",12.3457890125q23)


This will round the number to 2dp. The result in mytext will be "12.35". Hence the last digit rounding

Hope that helps ^_^
Andy
 
Share this answer
 
Comments
CPallini 10-Sep-15 6:20am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900