I need a regular expression for adding a dot as a thousand and millon separator in Javascript. I've searched the whole web without finding the format I need. It would return this:
1
12
123
1.234
12.345
123.456
1.234.567
12.345.678
123.456.789
I'm trying to use it in an input.
handleIdChange = (personalIdNumber) => {
this.validator.updateField("personalId", {
number: personalIdNumber
})
this.props.setVisitorField({
field: "personalId.number",
value: personalIdNumber
});
<CLTextInput
highContrast={true}
onChangeText={this.handleIdChange}
keyboardType="numeric"
placeholder="Número"
returnKeyType="next"
autoCapitalize="none"
autoCorrect={false}
value={visitor.personalId.number}
error={this.shouldShowError("personalId")}
accessibility
/>