how can i change html input to change to decimal when pressing comma while typing

I have a number input. While typing on it, if you press dot (‘.’), you change to decimal part. But if you press comma (‘,’), nothing happens. I want it to also change to decimal typing, just like when you press dot.
Is it possible to do this?

It is hard for me to explain my problem, so; hard to search for a solution too.