Best practice to work with input numbers and decimal separator (input mask)

Dears, what is the correct and best practice (easy programatically) to work with input number (mask) and two or three digit as separator (like currency, weight measure), considering countries which have comma as separator decimal? Thanks!