UNPKG
json-editor
Version:
latest (0.7.28)
0.7.28
0.7.27
0.7.26
0.7.25
0.7.23
0.7.22
0.7.21
0.7.20
0.7.19
0.7.18
0.7.17
0.7.16
0.7.15
0.7.14
0.7.13
0.7.12
0.7.11
0.7.10
0.7.9
JSON Schema based editor
github.com/jdorn/json-editor
jdorn/json-editor
json-editor
/
src
/
editors
/
number.js
12 lines
(11 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
JSON
Editor.
defaults
.
editors
.
number
=
JSON
Editor.
defaults
.
editors
.
string
.
extend
({
sanitize
:
function
(
value
) {
return
(value+
""
).
replace
(
/[^0-9\.\-eE]/g
,
''
); },
getNumColumns
:
function
(
) {
return
2
; },
getValue
:
function
(
) {
return
this
.
value
*
1
; } });