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