Java BigDecimal to bigDecimalToDbString(BigDecimal bd)

Here you can find the source of bigDecimalToDbString(BigDecimal bd)

Description

Converts the BigDecimal bd into something formatted properly for MySQL.

License

Open Source License

Declaration

public static String bigDecimalToDbString(BigDecimal bd) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {
    /**/*ww w  .j a  va  2 s .  c om*/
     * Converts the BigDecimal {@code bd} into something formatted properly
     * for MySQL. The current implementation simply converts a null input to the
     * String "NULL"; returns {@code bd.toString()} otherwise.
     */
    public static String bigDecimalToDbString(BigDecimal bd) {
        return (bd == null) ? "NULL" : bd.toString();
    }
}

Related

  1. bigDecimalToByte(BigDecimal num)
  2. bigDecimalToBytes(BigDecimal decimal)
  3. bigDecimalToInteger(BigDecimal value)
  4. bigDecimaltoJSONString(Object obj)
  5. bigDecimalToLong(BigDecimal bigDecimal)
  6. bigDecimalToLong(BigDecimal value)