asp.net - how to convert 44/5 in C# to get decimal values? -


this question has answer here:

how convert 44/5 in c# decimal values actual result 13.75 got 13

need 13.75 how tried many solutions not possible please find

-----------tried methods--------------------

protected void txtbox_textchanged(object sender, eventargs e) {     int cal= 55 / 4;  //13      decimal cal= 55 / 4;  //13      string cal= string.format("{0:0.00}", 55 / 4);  //13.00      decimal cal= decimal.floor(55 / 4);     //13      salesprice.text = cal.tostring(); } 

try doing: decimal cal = 55m/4;


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -