Java BigDecimal



  • Good afternoon, please tell me... how with BigDecimal's help to form and retain the amount of 123.00 if you transferred it as 123?

    No similar formats have been found, I appreciate your help.



  • Thank you, everyone. Decided. To maintain String, a format is appropriate:

     public static String toString(BigDecimal bigDecimal) {
    
        DecimalFormat numFormat;
        String number;
    
        numFormat = new DecimalFormat(".00");
        number = numFormat.format(bigDecimal);
        return number;
    }
    




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2