We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95184f4 commit 3950baeCopy full SHA for 3950bae
jp.htm
@@ -158,7 +158,10 @@
158
}
159
160
// table body => sell
161
- JPYtoHKD = 0.05
+ // JPYtoHKD = 0.05
162
+ JPYtoHKD = getJPYtoHKDrate();
163
+
164
165
for (var i = 0; i <= maxRow; i++) {
166
consideration = curSellPrice * qty;
167
otherFee = getOtherFee(curSellPrice, qty, "sell");
@@ -371,6 +374,20 @@
371
374
372
375
373
376
377
378
+ function getJPYtoHKDrate() {
379
+ const apiUrl = `https://open.er-api.com/v6/latest/JPY`; // Example API endpoint
380
381
+ const response = await fetch(apiUrl);
382
+ const data = await response.json();
383
384
+ // Extract the JPY to HKD rate
385
+ const rate = data.rates.HKD;
386
+ return rate.toFixed(4);
387
+ }
388
389
390
391
</script>
392
393
0 commit comments