Within my Angular form group, I have 3 fields. One of these fields serves as a tool for the user, automatically calculating the value based on another field. Essentially, when a user inputs a number, the tool field displays that value divided by 100.
Here is the structure of my form:
formGroup = new FormGroup({
Buildyear: new FormControl(this.buildyear, [Validators.minLength(4), Validators.maxLength(4)]),
Areasize: new FormControl(this.areasize, [Validators.required] ),
Areasize_divided: new FormControl(''),
});
The "Areasize_divided" field takes the value of "Areasize" and divides it automatically. Initially, there is a default value in this field, but if the user updates "Areasize", the division in "Areasize_divided" should reflect that change. Conversely, if the user inputs a value into "Areasize_divided", "Areasize" will be multiplied by 100.
What would be the most effective approach to implement this functionality?