# NOT RUN {
# Register an input handler which rounds a input number to the nearest integer
registerInputHandler("mypackage.validint", function(x, shinysession, name) {
if (is.null(x)) return(NA)
round(x)
})
## On the Javascript side, the associated input binding must have a corresponding getType method:
getType: function(el) {
return "mypackage.validint";
}
# }
Run the code above in your browser using DataLab