Developer

|

Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

HTML.Partial vs. HTML.RenderPartial and HTML.Action vs. HTML.RenderAction: A Comprehensive Comparison When working with ASP.NET MVC or ASP.NET Core MVC, developers often encounter scenarios where they need to include reusable components or partial views within their web applications. Two commonly used…

String.Format way to format Currency without Cents

Specify you want zero decimal places: String.Format(“{0:C0}”, item.DonationAmount) Other Way decimal value = 0.00M; value = Convert.ToDecimal(12345.12345); Console.WriteLine(“.ToString(\”C\”) Formates With Currency $ Sign”); Console.WriteLine(value.ToString(“C”)); //OutPut : $12345.12 Console.WriteLine(value.ToString(“C1”)); //OutPut : $12345.1 Console.WriteLine(value.ToString(“C2”)); //OutPut : $12345.12 Console.WriteLine(value.ToString(“C3”)); //OutPut : $12345.123 Console.WriteLine(value.ToString(“C4”));…