Ajouter le signe négatif à un valeur de type ‘BigDecimal’

Author:

 java
Download

 
import java.math.BigDecimal;
 
public class NegatBigDec
{
 
  public static void main(String[] argv) throws Exception
  	{
    BigDecimal val = new BigDecimal("642014.23");
 
    // Ajouter le signe "-"
    val = val.negate();
 
    System.out.println (val);
 
  }
}

Cet article Ajouter le signe négatif à un valeur de type ‘BigDecimal’ est apparu en premier sur .