UNPKG

json-editor

Version:
12 lines (11 loc) 274 B
JSONEditor.defaults.editors.number = JSONEditor.defaults.editors.string.extend({ sanitize: function(value) { return (value+"").replace(/[^0-9\.\-eE]/g,''); }, getNumColumns: function() { return 2; }, getValue: function() { return this.value*1; } });