This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ different currencies and also pay the invoice.
120
120
return this.convertCurrency(this.qty * this.cost, this.inCurr, outCurr);
121
121
};
122
122
this.convertCurrency = function convertCurrency(amount, inCurr, outCurr) {
123
- return amount * this.usdToForeignRates[outCurr] * 1 / this.usdToForeignRates[inCurr];
123
+ return amount * this.usdToForeignRates[outCurr] / this.usdToForeignRates[inCurr];
124
124
};
125
125
this.pay = function pay() {
126
126
window.alert("Thanks!");
@@ -207,7 +207,7 @@ Let's refactor our example and move the currency conversion into a service in an
207
207
};
208
208
209
209
function convert(amount, inCurr, outCurr) {
210
- return amount * usdToForeignRates[outCurr] * 1 / usdToForeignRates[inCurr];
210
+ return amount * usdToForeignRates[outCurr] / usdToForeignRates[inCurr];
211
211
}
212
212
});
213
213
</file>
@@ -336,7 +336,7 @@ The following example shows how this is done with Angular:
336
336
};
337
337
338
338
function convert(amount, inCurr, outCurr) {
339
- return amount * usdToForeignRates[outCurr] * 1 / usdToForeignRates[inCurr];
339
+ return amount * usdToForeignRates[outCurr] / usdToForeignRates[inCurr];
340
340
}
341
341
342
342
function refresh() {
You can’t perform that action at this time.
0 commit comments