diff --git a/engine/src/main/java/com/arcadedb/function/polyglot/JavascriptFunctionDefinition.java b/engine/src/main/java/com/arcadedb/function/polyglot/JavascriptFunctionDefinition.java index 4dd59f3702..34fe01c7e1 100644 --- a/engine/src/main/java/com/arcadedb/function/polyglot/JavascriptFunctionDefinition.java +++ b/engine/src/main/java/com/arcadedb/function/polyglot/JavascriptFunctionDefinition.java @@ -118,7 +118,7 @@ else if (result.fitsInLong()) else if (result.fitsInFloat()) return result.asFloat(); else - return result.asFloat(); + return result.asDouble(); } else if (result.isNull()) return null; diff --git a/engine/src/main/java/com/arcadedb/utility/DateUtils.java b/engine/src/main/java/com/arcadedb/utility/DateUtils.java index a6415a748c..795789c43f 100755 --- a/engine/src/main/java/com/arcadedb/utility/DateUtils.java +++ b/engine/src/main/java/com/arcadedb/utility/DateUtils.java @@ -344,8 +344,8 @@ public static LocalDate millisToLocalDate(final long millis) { } public static String format(final Object obj, final String format) { - if (obj instanceof Long) - return getFormatter(format).format(millisToLocalDateTime((Long) obj)); + if (obj instanceof Number) + return getFormatter(format).format(millisToLocalDateTime(((Number) obj).longValue())); else if (obj instanceof Date) return getFormatter(format).format(millisToLocalDateTime(((Date) obj).getTime())); else if (obj instanceof Calendar)