回答編集履歴

1

chousei

2021/10/08 04:47

投稿

yambejp
yambejp

スコア116849

test CHANGED
@@ -5,3 +5,65 @@
5
5
  変換しても正確な演算をすることはできません。
6
6
 
7
7
  演算に利用できないなら普通に文字列でもっておけばいいでしょう
8
+
9
+
10
+
11
+ ```php
12
+
13
+ <?PHP
14
+
15
+ $loans=[
16
+
17
+ [
18
+
19
+ "id" => 1 ,
20
+
21
+ "name" => "loan_A" ,
22
+
23
+ "ttl" => "9000000000" ,
24
+
25
+ "edate" => "2021-04-28" ,
26
+
27
+ "mdate" => "2030-04-26" ,
28
+
29
+ "type" => "変動" ,
30
+
31
+ "spread" => "0.27500000000000002220446049250313080847263336181640625" ,
32
+
33
+ ],
34
+
35
+ [
36
+
37
+ "id" => 2 ,
38
+
39
+ "name" => "loan_B" ,
40
+
41
+ "ttl" => "5000000000" ,
42
+
43
+ "edate" => "2022-04-28" ,
44
+
45
+ "mdate" => "2031-04-26" ,
46
+
47
+ "type" => "",
48
+
49
+ "spread" => "0.2250000000000000055511151231257827021181583404541015625" ,
50
+
51
+ ],
52
+
53
+ ];
54
+
55
+ print_r($loans);
56
+
57
+ ?>
58
+
59
+ <script>
60
+
61
+ var loans =<?=json_encode($loans,JSON_UNESCAPED_UNICODE)?>;
62
+
63
+ loans.forEach(x=>x.ttl=BigInt(x.ttl));
64
+
65
+ console.log((loans[0]["ttl"]));
66
+
67
+ </script>
68
+
69
+ ```