Такой JS, отсюда нужно
https://bank.gov.ua/NBUStatService/v1/statdirector... подтянуть <rate> и нужно в строке
var payment = (( w * 1 ) + ( h * 1 ) + ( t * 1 ) + ( p * 1 ) + ( m * 1 )) * r || 0;
чтобы r была тем числом из строки.
var calculator = new Vue({
el: '#calculator',
data: {
width: '',
height: '',
position: '',
tradeIn: '',
mark: '',
calcPayment: ''
},
computed: {
calcPayment: function(e){
var w = this.width;
var h = this.height;
var p = this.position;
var t = this.tradeIn;
var m = this.mark;
var payment = (( w * 1 ) + ( h * 1 ) + ( t * 1 ) + ( p * 1 ) + ( m * 1 )) * r || 0;
return currencyFormat(payment);
},
numFormat: function(e){
e.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
}
}
});
//https://blog.tompawlak.org/number-currency-formatting-javascript
function currencyFormat (num) {
return "" + num.toFixed(0).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
}