-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmz.html
130 lines (125 loc) · 5.08 KB
/
mz.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!doctype html>
<html lang="fa" dir="rtl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="طلا، محاسبه قیمت طلا، محاسبه قیمت آنلاین طلا، ماشین حساب طلا">
<meta name="keywords" content="طلا، محاسبه قیمت طلا، محاسبه قیمت آنلاین طلا، ماشین حساب طلا">
<meta name="author" content="https://github.com/IAliReza">
<meta name="generator" content="0.2">
<title>ماشین حساب طلا</title>
<link rel="stylesheet" href="assets/css/bootstrap.rtl.min.css"/>
<link rel="stylesheet" href="assets/css/custom.css"/>
<link rel="stylesheet" href="assets/css/font-face.css"/>
<link rel="icon" sizes="32x32" type="image/png" href="assets/img/32.png">
<link rel="manifest" href="manifest.webmanifest">
<meta name="theme-color" content="#cdb398">
</head>
<body class="bg-light">
<div class="container">
<header class="py-3 mb-3 border-bottom">
<div class="container-fluid d-grid gap-3 align-items-center" style="grid-template-columns: 1fr 2fr;">
<div class="dropdown">
<a href="#"
class="d-flex align-items-center col-lg-4 mb-2 mb-lg-0 link-body-emphasis text-decoration-none dropdown-toggle"
data-bs-toggle="dropdown" aria-expanded="false">
منو
</a>
<ul class="dropdown-menu text-small shadow" style="">
<li>
<a class="dropdown-item" href="index.html">خانه</a>
</li>
<li>
<a class="dropdown-item" href="mz.html">مظنه</a>
</li>
<li>
<a class="dropdown-item" href="oz.html">اونس</a>
</li>
<li>
<a class="dropdown-item" href="bubble.html">حباب</a>
</li>
<li>
<a class="dropdown-item" href="https://AliRezaMohammadiDoost.Ir" target="_blank">تماسبا ما</a>
</li>
<li>
<a class="dropdown-item" href="https://github.com/ialireza/gold-calculator" target="_blank">
منبع و توضیحات
</a>
</li>
</ul>
</div>
</div>
</header>
<div class="row">
<div class="col-lg-6 mt-5">
<h5>جزئیات کالا</h5>
<div class="col-12">
<label for="mz" class="form-label">
نرخ مظنه
<i class="bi bi-arrow-down"></i>
</label>
<div class="input-group mb-3">
<input type="text" class="form-control form_input" id="mz" dir="ltr" required
onkeyup="priceSeparator(this.value,this);"
onfocus="priceSeparator(this.value,this);">
<span class="input-group-text text-bg-warning">تومان</span>
</div>
<div class="invalid-feedback">
Valid first name is required.
</div>
</div>
</div>
<div class="col-lg-6 mt-5">
<h5>جزئیات سفارش</h5>
<div class="table-responsive text-center">
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 35%">نوع</th>
<th>مبلغ</th>
</tr>
</thead>
<tbody>
<tr>
<td>750</td>
<td id="r1"></td>
</tr>
<tr>
<td>740</td>
<td id="r2"></td>
</tr>
</tbody>
</table>
</div>
<button class="w-100 btn btn-lg btn-custom" type="submit" id="submit">محاسبه قیمت</button>
</div>
</div>
</div>
<script src="assets/js/jquery-3.6.0.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script>
$(function () {
$('#submit').click(function () {
mz = $('#mz').val();
separateNum(parseFloat(((mz / 4.6083) / 705) * 750), '#r1');
separateNum(parseFloat(((mz / 4.6083) / 705) * 740), '#r2');
});
});
function separateNum(value, result) {
let nStr = value + '';
nStr = nStr.replace(/\,/g, "");
let x = nStr.split('.');
let x1 = x[0];
let x2 = x.length > 1 ? '.' + x[1] : '';
let rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
if (x1 + x2 != 'NaN') {
$(result).html(x1 + x2);
}
}
</script>
<script src="sw.js"></script>
</body>
</html>