How to make input only float numbers and replace "," with "." in keyup?

Generally there is input , it is necessary that this input can only accept data of type int or float and that if you enter a comma , it has varied on the point . You need to do in the keyup event . Tell me how to do it?
July 2nd 19 at 18:24
1 answer
July 2nd 19 at 18:26
Why not add type="number" to your input not poispolzovat ready-made functionality (instead of to invent a Bicycle)? codepen.io/sfi0zy/pen/YpXgeM

Find more questions by tags jQueryJavaScript