Use data-maskto the input element.
data-mask
Automatically format currency and numbers as you type on form inputs.