Getting dollar symbol with currency amount

Madhu.b.rokkam
Posted by Madhu.b.rokkam under C# category on | Points: 40 | Views : 2077
decimal yourNumber = 75.45M;
Console.WriteLine(yourNumber.ToString("c", new CultureInfo("en-US")));


result
$75.45

decimal yourNumber = 125;
Console.WriteLine(yourNumber.ToString("c", new CultureInfo("en-US")));


result
$125.00

Comments or Responses

Login to post response