-
Notifications
You must be signed in to change notification settings - Fork 0
/
Render_Orderbook.html
58 lines (46 loc) · 1.76 KB
/
Render_Orderbook.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<meta charset="utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="author" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://fonts.googleapis.com/css?family=Inconsolata&display=swap" rel="stylesheet">
<link href="style.css" rel="stylesheet" />
<script src="OrderBookFormatting.js"></script>
<title>Render Orderbook</title>
</head>
<body onload="test();">
<!---->
<p>
Render Orderbook?<br />
<input type="button" id="btnTest" name="btnTest" onclick="renderOrderBookHTML();" value="RENDER" />
</p>
<hr />
<div id="orderbook">
</div>
</body>
</html>
<script type="text/javascript">
function test() {
console.log(`>>> BEGIN TEST`);
//TEST: splitWeakStrong
var ref = "7265.3";
var somenumber = "17264.4";
var ref = "17264.4";
var somenumber = "17265.3";
var parts = new Array(2);
parts = splitWeakStrong(somenumber, ref);
priceweak = parts[0];
pricestrong = parts[1];
var refhtml = `<div id="price"><span class=\"buyweak\"></span><span class=\"buystrong\">${ref}</span></div>`;
var somenumbertemplate = `<div id="price"><span class=\"buyweak\">${priceweak}</span><span class=\"buystrong\">${pricestrong}</span></div>`;
var result = refhtml + somenumbertemplate + "";
document.getElementById("orderbook").innerHTML = result;
//TEST: splitIntegerPart
var number1 = "1.531,4063";
parts = new Array(2);
parts = splitIntegerPart(number1, ',');
console.log(`<<< END TEST`);
}
</script>