Click here to Skip to main content
16,018,418 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
how to implement CAST(131 AS DECIMAL(10, 2)) in c# ,net or asp.net
Posted

C#
int i = 131;
decimal d = (decimal)i / 100;

Give it a try.This may work.
 
Share this answer
 
Try this one.

Math.Round(Convert.ToDecimal(131), 2);


Live Test : ideone
 
Share this answer
 
v3
Comments
Karthik_Mahalingam 20-Jan-14 2:08am    
5!
Sampath Lokuge 20-Jan-14 2:10am    
Thanks Karthik :)
Karthik_Mahalingam 20-Jan-14 2:27am    
welcome :)

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