Java BigDecimal to bigDecimaltoJSONString(Object obj)

Here you can find the source of bigDecimaltoJSONString(Object obj)

Description

bigDecimaltoJSONString

License

Open Source License

Parameter

Parameter Description
obj , a number

Return

str, a line of JSON code representing obj

Declaration

public static String bigDecimaltoJSONString(Object obj) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    /**//from   w  w w.  j  a  v a  2 s  .  c om
     * bigDecimaltoJSONString
     * 
     * @param obj
     *          , a number
     * @return str, a line of JSON code representing obj
     * @pre Object obj, a BigDecimal
     * @post Returns the corresponding JSONString for obj.
     */
    public static String bigDecimaltoJSONString(Object obj) {
        BigDecimal number = (BigDecimal) obj;
        return number.toString();
    }
}

Related

  1. bigDecimalToByte(BigDecimal num)
  2. bigDecimalToBytes(BigDecimal decimal)
  3. bigDecimalToDbString(BigDecimal bd)
  4. bigDecimalToInteger(BigDecimal value)
  5. bigDecimalToLong(BigDecimal bigDecimal)
  6. bigDecimalToLong(BigDecimal value)
  7. bigDecimalToStellarBalance(final BigDecimal balance)
  8. bigDecimalToString(BigDecimal bigDecimal)