Put a key/double pair in the JSONObject.

@param key   A key string.
@param value A double which is the value.
@return this
@throws JSONException If the key is null or if the number is invalid.
342413
public JSONObject put(String key, double value) throws JSONException {
        put(key, Double.valueOf(value));
        return this;
    }
1303151
public JSONObject element( String key, int value ) {
      verifyIsNull();
      return element( key, new Integer( value ) );
   }
323234
public JSONObject put(String key, boolean value) throws JSONException {
        return this.put(key, value ? Boolean.TRUE : Boolean.FALSE);
    }
619383
public JSONObject element( String key, Collection value, JsonConfig jsonConfig ) {
      if( !(value instanceof JSONArray) ){
         value = JSONArray.fromObject( value, jsonConfig );
      }
      return setInternal( key, value, jsonConfig );
   }
529999
public String put(final String key, final Double value) {
    return this._current.put(key, value.toString());
  }
920073
public static JSONObject getObject(JSONValue value) {
        if (value == null)
            return null;
        if (!(value instanceof JSONObject))
            throw new JSONException(NOT_AN_OBJECT);
        return (JSONObject)value;
    }
37419
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
        boolean isValueNumeric = false;

        try {
            if (value.equals("0") || !value.endsWith("0")) {
                Double.parseDouble(value);
                isValueNumeric = true;
            }
        } catch (NumberFormatException e) {
            isValueNumeric = false;
        }

        if (json.charAt(json.length() - 1) != '{') {
            json.append(',');
        }

        json.append(escapeJSON(key));
        json.append(':');

        if (isValueNumeric) {
            json.append(value);
        } else {
            json.append(escapeJSON(value));
        }
    }
230602
public void setValue(Enum key, double value) {
    this._task.put(key, Double.toString(value));
  }
607867
public JsonWriter key(double key) {
        startKey();

        writer.write('\"');
        final long i = (long) key;
        if (key == (double) i) {
            writer.print(i);
        } else {
            writer.print(key);
        }
        writer.write('\"');
        writer.write(':');
        return this;
    }
738321
Item newDouble(final double value) {
        key.set(value);
        Item result = get(key);
        if (result == null) {
            pool.putByte(DOUBLE).putLong(key.longVal);
            result = new Item(index, key);
            put(result);
            index += 2;
        }
        return result;
    }
659084
public static void jsonValue(JsonWriter writer, Object value) throws IOException {
        if (value == null) {
            writer.nullValue();
        } else {
            if (value instanceof Map) {
                jsonMap(writer, (Map<String, Object>) value);
            } else if (value instanceof Collection) {
                writer.beginArray();
                for (Object val : ((Collection) value)) {
                    jsonValue(writer, val);
                }
                writer.endArray();
            } else if (value instanceof Object[]) {
                writer.beginArray();
                for (Object val : ((Object[]) value)) {
                    jsonValue(writer, val);
                }
                writer.endArray();
            } else if (value instanceof Boolean) {
                writer.value((Boolean) value);
            } else if (value instanceof Long) {
                writer.value((Long) value);
            } else if (value instanceof Double) {
                writer.value((Double) value);
            } else if (value instanceof Number) {
                writer.value((Number) value);
            } else {
                writer.value(value.toString());
            }
        }
    }
567136
public JSONNavi<T> set(String key, double value) {
		return set(key, Double.valueOf(value));
	}
1045605
public void setDouble(Double value) {
		this.checkNull(value);
		list.add(value);
		type.add(Double.class);
	}
1319922
public void put(String key, Double value) {
		if (this.compiledStatement != null) {
			if (value == null) {
				this.compiledStatement.bindNull(compiledStatementBindIndex++);
			} else {
				this.compiledStatement.bindDouble(compiledStatementBindIndex++, value);
			}
		} else if (values != null) {
			values.put(key, value);
			return;
		}

		names.add(key);
		// values.put(key, value);
		args.add(value);
		valueType.add(ParamType.DOUBLE);
	}
702793
public JSONObject put(Enum<?> key, boolean value) throws JSONException {
		return put(key.name(), value);
	}
391944
public static Double toDouble(Object value) {
        if (value == null) {
            return null;
        } else if (value instanceof Double) {
            return (Double) value;
        } else if (value instanceof Number) {
            return ((Number) value).doubleValue();
        } else {
            try {
                return Double.valueOf(value.toString().trim());
            } catch (NumberFormatException e) {
                throw new ConversionException("failed to convert: '" + value + "' to Double", e);
            }
        }
    }
200196
public double getDouble(int index) throws JSONException {
        Object object = this.get(index);
        try {
            return object instanceof Number ? ((Number) object).doubleValue()
                    : Double.parseDouble((String) object);
        } catch (Exception e) {
            throw new JSONException("JSONArray[" + index + "] is not a number.");
        }
    }