Skip to content

Commit fd20c0f

Browse files
authored
Update hk.htm
1 parent c547242 commit fd20c0f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

hk.htm

+9-5
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@
7272
el_bottomDiv.classList.add("bottom-section");
7373

7474
var tHeader = ["","Price", "Qty", "G/L HKD", "BidSize", "Consideration", "Platform", "Settlement",
75-
"AdValStamp", "FRCLevy", "Trading", "XactLevy", "OtherTotal", "TotalAmount", "GainLoss(%)"];
75+
"AdValStamp"," Trading", "XactLevy", "FRCLevy", "OtherTotal", "TotalAmount", "GainLoss(%)"];
7676

7777
var sellId = ["s_title","s_Price","s_Qty", "s_GL_HKD", "s_BidSize", "s_Consideration", "s_Platform", "s_Settlement",
78-
"AdValStamp", "s_FRCLevy", "s_Trading", "s_XactLevy", "s_OtherTotal", "s_TotalAmount", "s_GainLoss"];
78+
"AdValStamp", "s_Trading", "s_XactLevy", "s_FRCLevy", "s_OtherTotal", "s_TotalAmount", "s_GainLoss"];
7979

8080
var el_table = document.createElement("table");
8181
el_table.id = "mainTable";
@@ -97,9 +97,9 @@
9797
fmtDecimal(otherFee.platform),
9898
fmtDecimal(otherFee.settlement),
9999
fmtDecimal(otherFee.adValStamp),
100-
fmtDecimal(otherFee.frcLevy),
101100
fmtDecimal(otherFee.trading),
102101
fmtDecimal(otherFee.xactLevy),
102+
fmtDecimal(otherFee.frcLevy),
103103
fmtDecimal(otherFee.total),
104104
fmtDecimal(buyTotalAmount),
105105
"0"],
@@ -151,9 +151,9 @@
151151
fmtDecimal(otherFee.platform),
152152
fmtDecimal(otherFee.settlement),
153153
fmtDecimal(otherFee.adValStamp),
154-
fmtDecimal(otherFee.frcLevy),
155154
fmtDecimal(otherFee.trading),
156155
fmtDecimal(otherFee.xactLevy),
156+
fmtDecimal(otherFee.frcLevy),
157157
fmtDecimal(otherFee.total),
158158
fmtDecimal(sellTotalAmount),
159159
fmtDecimal(gl) + " (" + fmtDecimal(glPcent) + ")",
@@ -205,10 +205,12 @@
205205

206206
function fmtDecimal(num) {
207207
// Multiply by 1000 to shift the decimal point
208-
const shifted = Math.round(num * 1000);
208+
//const shifted = Math.round(num * 1000);
209+
const shifted = num * 1000;
209210

210211
// Extract the first two decimal places
211212
const wholePart = Math.floor(shifted / 10); // Get the whole number part
213+
212214
const decimalPart = shifted % 10; // Get the third decimal place
213215

214216
// If the third decimal place is greater than 1, add it to the second decimal place
@@ -219,6 +221,8 @@
219221
}
220222

221223
return newNum.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
224+
225+
222226
}
223227

224228

0 commit comments

Comments
 (0)