# Using getters and setters Part 2

This is second part in the series to make use of getters and setters in an AlpineJS object, that converts INR to USD.

Well, only a **setter** has been used here where a function call is made to the setter `priceInINR` when the textbox of the USD value changes. The setter changes the value of the product's (which is an argument to `priceInINR`) `price_INR` value.

`x-on:input="$`[`store.global`](http://store.global)`_data.priceInINR = product"`

And the setter :

```javascript
set priceInINR(p)
{            
    const product = this.products.find(product => product.name === p.name);
    product.price_INR = p.price_USD * 83;
},
```

Here's the full source code.

%[https://gist.github.com/anjanesh/2563f0155a4e303dcd39aa9d3c4e2c7f] 

PS: 1 USD = 83 INR as of 17th February 2024.

Here's a more interactive example / demo : [https://anjanesh.s3.amazonaws.com/demo/alpine/alpine-auto-update-variable-method-1.html](https://anjanesh.s3.amazonaws.com/demo/alpine/alpine-auto-update-variable-method-1.html)
