How to use Decimal.Negate method to get the result of a decimal multiplied by -1 in C#

1 Answer

0 votes
using System;
   
class Program
{
    static void Main() {
        Console.WriteLine(Decimal.Negate(8752.781m));

        Console.WriteLine(Decimal.Negate(-4.93m));
    }
}
  
   
   
   
/*
run:
   
-8752.781
4.93
 
*/

 



answered Aug 4, 2022 by avibootz
...