code: public static String amountToStr(final BigDecimal amount) {
          if (amount == null) {
              return null;
          }
          final BigInteger unscaled = amount.unscaledValue();
          if (unscaled.equals(BigInteger.ZERO)) {
              return "0." + repeat(amount.scale(), '0');
          }
          final String unscaledStr = unscaled.toString();
          if (amount.scale() == 0) {
              return unscaledStr;
          }
          final int p = unscaledStr.length() - amount.scale();
          if (p == 0) {
              return "0." + unscaledStr;
          }
          return unscaledStr.substring(0, p) + "." + unscaledStr.substring(p);
      }
docs: Converts a big decimal into a canonical string representation. A <code>null</code> argument will return <code>null</code>.
  
  @param amount
  Amount to convert.
  
  @return Amount as string.