|
72 | 72 | el_bottomDiv.classList.add("bottom-section");
|
73 | 73 |
|
74 | 74 | 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(%)"]; |
76 | 76 |
|
77 | 77 | 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"]; |
79 | 79 |
|
80 | 80 | var el_table = document.createElement("table");
|
81 | 81 | el_table.id = "mainTable";
|
|
97 | 97 | fmtDecimal(otherFee.platform),
|
98 | 98 | fmtDecimal(otherFee.settlement),
|
99 | 99 | fmtDecimal(otherFee.adValStamp),
|
100 |
| - fmtDecimal(otherFee.frcLevy), |
101 | 100 | fmtDecimal(otherFee.trading),
|
102 | 101 | fmtDecimal(otherFee.xactLevy),
|
| 102 | + fmtDecimal(otherFee.frcLevy), |
103 | 103 | fmtDecimal(otherFee.total),
|
104 | 104 | fmtDecimal(buyTotalAmount),
|
105 | 105 | "0"],
|
|
151 | 151 | fmtDecimal(otherFee.platform),
|
152 | 152 | fmtDecimal(otherFee.settlement),
|
153 | 153 | fmtDecimal(otherFee.adValStamp),
|
154 |
| - fmtDecimal(otherFee.frcLevy), |
155 | 154 | fmtDecimal(otherFee.trading),
|
156 | 155 | fmtDecimal(otherFee.xactLevy),
|
| 156 | + fmtDecimal(otherFee.frcLevy), |
157 | 157 | fmtDecimal(otherFee.total),
|
158 | 158 | fmtDecimal(sellTotalAmount),
|
159 | 159 | fmtDecimal(gl) + " (" + fmtDecimal(glPcent) + ")",
|
|
205 | 205 |
|
206 | 206 | function fmtDecimal(num) {
|
207 | 207 | // 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; |
209 | 210 |
|
210 | 211 | // Extract the first two decimal places
|
211 | 212 | const wholePart = Math.floor(shifted / 10); // Get the whole number part
|
| 213 | + |
212 | 214 | const decimalPart = shifted % 10; // Get the third decimal place
|
213 | 215 |
|
214 | 216 | // If the third decimal place is greater than 1, add it to the second decimal place
|
|
219 | 221 | }
|
220 | 222 |
|
221 | 223 | return newNum.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
| 224 | + |
| 225 | + |
222 | 226 | }
|
223 | 227 |
|
224 | 228 |
|
|
0 commit comments