fork(31) download
  1. using System;
  2. using System.Globalization;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. Decimal dec = new Decimal(-1234.4321);
  9. CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
  10. culture.NumberFormat.CurrencyNegativePattern = 1;
  11. String str = String.Format(culture, "{0:C}", dec);
  12. Console.Write(str);
  13. }
  14. }
Success #stdin #stdout 0.03s 37024KB
stdin
Standard input is empty
stdout
-$1,234.43