Технически, вы можете создать свой собственный CultureInfo
, например,
// Same as US
CultureInfo myUSCulture = new CultureInfo("en-US", true);
// Except dollar sign removed
myUSCulture.NumberFormat.CurrencySymbol = "";
// and negative pattern changed: "-value" instead of "(value)"
myUSCulture.NumberFormat.CurrencyNegativePattern = 1;
Затем использовать его:
decimal TrnAmount = -123456789.987M;
Console.WriteLine(TrnAmount.ToString("C3", myUSCulture)); // exactly 3 digits after .
Console.WriteLine(TrnAmount.ToString("C2", myUSCulture));
Console.WriteLine(TrnAmount.ToString("C0", myUSCulture)); // no floating point
Результат:
-123,456,789.987
-123,456,789.99 // rounded
-123,456,790 // rounded