Skip to content

Commit 51a9800

Browse files
author
Ben Baumgold
committed
force js_max_safe_int to be type Int128 and limit condition from type Number to type Real
1 parent d7d9373 commit 51a9800

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TableView.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Observables: @map
77
export showtable
88

99
const ag_grid_imports = []
10-
const js_max_safe_int = 2^53-1
10+
const js_max_safe_int = Int128(2^53-1)
1111

1212
function __init__()
1313
version = readchomp(joinpath(@__DIR__, "..", "ag-grid.version"))
@@ -264,7 +264,7 @@ function table2json(schema, rows, types; requested = nothing)
264264
columnwriter = JSON.Writer.CompactContext(io)
265265
JSON.begin_object(columnwriter)
266266
Tables.eachcolumn(schema, row) do val, ind, name
267-
if val isa Number && isfinite(val) && -js_max_safe_int < val < js_max_safe_int
267+
if val isa Real && isfinite(val) && -js_max_safe_int < val < js_max_safe_int
268268
JSON.show_pair(columnwriter, ser, name, val)
269269
elseif val === nothing || val === missing
270270
JSON.show_pair(columnwriter, ser, name, repr(val))

0 commit comments

Comments
 (0)