To make the input format dynamically might be a little bit confusing to the users (they type something and it changes). But if you want it anyway you can do something like this (and use for example the German locale which adds for thousands):
$w('#input1').onInput(() => {
$w('#input1').value = Number(
$w('#input1').value
.replaceAll('.','')
)
.toLocaleString('de-DE');
})
[EDITED]