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

Author:

 java
{filelink=11209}


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);

  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *