From 5afd93e2d157e7a2e02b00d99dcd502a4ae11e70 Mon Sep 17 00:00:00 2001 From: jamessspanggg Date: Tue, 7 Jan 2020 10:09:28 +0800 Subject: [PATCH] Standardise 'edit' cell dialogue with 'toNumber()' behavior --- .../com/google/refine/commands/cell/EditOneCellCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/src/com/google/refine/commands/cell/EditOneCellCommand.java b/main/src/com/google/refine/commands/cell/EditOneCellCommand.java index 55cf39252..62662d2dc 100644 --- a/main/src/com/google/refine/commands/cell/EditOneCellCommand.java +++ b/main/src/com/google/refine/commands/cell/EditOneCellCommand.java @@ -103,7 +103,11 @@ public class EditOneCellCommand extends Command { Serializable value = null; if ("number".equals(type)) { - value = Double.parseDouble(valueString); + try { + value = Long.parseLong(valueString); + } catch (NumberFormatException e) { + value = Double.parseDouble(valueString); + } } else if ("boolean".equals(type)) { value = "true".equalsIgnoreCase(valueString); } else if ("date".equals(type)) {