-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnitConversionCalculator.html
680 lines (568 loc) · 34.3 KB
/
UnitConversionCalculator.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="common.js"></script>
<link href="common.css" rel="stylesheet" />
<style>
.bg-light {
background-color: #521307!important;
}
.cmnLink{
color: white !important;
text-transform: capitalize !important;
border: 1px solid darkred !important;
margin-left: 5px !important;
}
.navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,102,203, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E") !important;
}
</style>
</head>
<body onload="Load()">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">
<span style="color: white;font-family: auto;text-shadow: 2px 0px cyan;font-size: 25px;">
<!-- W -->
</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon">
<i class="fas fa-bars" style="color:#fff; font-size:28px;"></i> </span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- <ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link cmnLink" href="/Cement Calculation/CementConcreteCalculator.html">Cement Concrete <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link cmnLink" href="/Cement Calculation/PlasteringCalculator.html">Plastering <span class="sr-only"></span></a>
</li>
</ul> -->
</div>
</nav>
<script>
var LengthOptionArr = [{"text":"Metre"},{"text":"Feet"},{"text":"Kilometre"},{"text":"Mile"},{"text":"Yard"},{"text":"Inch"},{"text":"Centimetre"}];
var AreaOptionArr = [{"text":"Square Metre"},{"text":"Square Feet"},{"text":"Square Yard"},{"text":"Hectare"},{"text":"Acre"},{"text":"Guntha"},{"text":"Vigha"}];
var VolumeOptionArr = [{"text":"Cubic Metre"},{"text":"Cubic Feet"},{"text":"Cubic Inch"}];
var ConversionType = "";
var meterToFoot = 3.28084;
var meterToKM = 1000;//Divide 1000
var meterToMile = 1609;//Divide divide the length value by 1609
var meterToYard = 1.094;//multiply
var meterToInch = 39.37;//multiply
var meterToCentimeter = 100// multiply the length value by 100
var DecimalPrecision = 0;
var Feet = 0;
var Kilometre = 0;
var Mile = 0;
var Yard = 0;
var Inch = 0;
var Centimetre = 0;
var unit = "";
var Value = 0;
function FormReset(){
document.getElementById("myForm").reset();
}
function Load() {
Value = document.getElementById("ValueTxt").value == ""?0:document.getElementById("ValueTxt").value ;
DecimalPrecision = document.getElementById("DecimalPrecision").value == ""?0:document.getElementById("DecimalPrecision").value ;
ConversionType = document.getElementById("ConversionType").value;
BindDropdown(ConversionType);
Calculate();
}
function ConversionChange(){
DecimalPrecision = document.getElementById("DecimalPrecision").value == ""?0:document.getElementById("DecimalPrecision").value ;
ConversionType = document.getElementById("ConversionType").value;
Value = document.getElementById("ValueTxt").value == ""?0:document.getElementById("ValueTxt").value ;
BindDropdown(ConversionType);
Calculate();
}
function UnitChange(){
DecimalPrecision = document.getElementById("DecimalPrecision").value == ""?0:document.getElementById("DecimalPrecision").value ;
Value = document.getElementById("ValueTxt").value == ""?0:document.getElementById("ValueTxt").value ;
Calculate();
}
function Calculate(){
DecimalPrecision = document.getElementById("DecimalPrecision").value == ""?0:document.getElementById("DecimalPrecision").value ;
unit = document.getElementById("unit").value;
Value = document.getElementById("ValueTxt").value == ""?0:document.getElementById("ValueTxt").value ;
SetLabelName(unit);
if(unit == "Metre"){
HideShowSecond();
Meter();
}
if(unit == "Feet"){
HideShowSecond();
FeetLoad();
}
if(unit == "Kilometre"){
HideShowSecond();
Km();
}
if(unit == "Mile"){
HideShowSecond();
MileLoad();
}
if(unit == "Yard"){
HideShowSecond();
YardLoad();
}
if(unit == "Inch"){
HideShowSecond();
InchLoad();
}
if(unit == "Centimetre"){
HideShowSecond();
CentimetreLoad();
}
if(unit == "Square Metre"){
HideShowSecond();
SQMeter();
}
if(unit == "Square Feet"){
HideShowSecond();
SQFeet();
}
if(unit == "Square Yard"){
HideShowSecond();
SQYard();
}
if(unit == "Hectare"){
HideShowSecond();
Heq();
}
if(unit == "Acre"){
HideShowSecond();
Acre();
}
if(unit == "Guntha"){
HideShowSecond();
Guntha();
}
if(unit == "Vigha"){
HideShowSecond();
Vigha();
}
if(unit == "Cubic Metre"){
HideShowFirst();
CubicMtr();
}
if(unit == "Cubic Feet"){
HideShowFirst();
CubicFeet();
}
if(unit == "Cubic Inch"){
HideShowFirst();
CubicInch();
}
}
function HideShowFirst(){
$("#first").hide();
$("#second").show();
}
function HideShowSecond(){
$("#first").show();
$("#second").hide();
}
function Meter(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Feet";
document.getElementById('Feet').innerHTML = ((Value * meterToFoot)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Kilometre";
document.getElementById('Km').innerHTML = ((Value / meterToKM)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Mile";
document.getElementById('Mile').innerHTML = ((Value / meterToMile)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Yard";
document.getElementById('Yard').innerHTML = ((Value * meterToYard)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Inch";
document.getElementById('Inch').innerHTML = ((Value * meterToInch)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Centimetre";
document.getElementById('Centimeter').innerHTML = ((Value * meterToCentimeter)).toFixed(DecimalPrecision);
}
function FeetLoad(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Meter";
document.getElementById('Feet').innerHTML = ((Value/3.281)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Kilometre";
document.getElementById('Km').innerHTML = ((Value/3281)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Mile";
document.getElementById('Mile').innerHTML = ((Value/5280)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Yard";
document.getElementById('Yard').innerHTML = ((Value/3)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Inch";
document.getElementById('Inch').innerHTML = ((Value*12)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Centimetre";
document.getElementById('Centimeter').innerHTML = ((Value*30.48)).toFixed(DecimalPrecision);
}
function Km(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Meter";
document.getElementById('Feet').innerHTML = ((Value*1000)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Feet";
document.getElementById('Km').innerHTML = ((Value*3281)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Mile";
document.getElementById('Mile').innerHTML = ((Value/1.609)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Yard";
document.getElementById('Yard').innerHTML = ((Value*1094)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Inch";
document.getElementById('Inch').innerHTML = ((Value*39370)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Centimetre";
document.getElementById('Centimeter').innerHTML = ((Value*100000)).toFixed(DecimalPrecision);
}
function MileLoad(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Meter";
document.getElementById('Feet').innerHTML = ((Value*1609)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Feet";
document.getElementById('Km').innerHTML = ((Value*5280)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Kilometre";
document.getElementById('Mile').innerHTML = ((Value*1.609)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Yard";
document.getElementById('Yard').innerHTML = ((Value*1760)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Inch";
document.getElementById('Inch').innerHTML = ((Value*63360)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Centimetre";
document.getElementById('Centimeter').innerHTML = ((Value*160934)).toFixed(DecimalPrecision);
}
function YardLoad(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Meter";
document.getElementById('Feet').innerHTML = ((Value*0.91)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Feet";
document.getElementById('Km').innerHTML = ((Value*3)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Kilometre";
document.getElementById('Mile').innerHTML = ((Value/1094)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "mile";
document.getElementById('Yard').innerHTML = ((Value/1760)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Inch";
document.getElementById('Inch').innerHTML = ((Value*36)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Centimetre";
document.getElementById('Centimeter').innerHTML = ((Value* 91.44)).toFixed(DecimalPrecision);
}
function InchLoad(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Meter";
document.getElementById('Feet').innerHTML = ((Value/39.37)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Feet";
document.getElementById('Km').innerHTML = ((Value/12)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Kilometre";
document.getElementById('Mile').innerHTML = ((Value/39370)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "mile";
document.getElementById('Yard').innerHTML = ((Value/63360)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Yard";
document.getElementById('Inch').innerHTML = ((Value/36)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Centimetre";
document.getElementById('Centimeter').innerHTML = ((Value*2.54)).toFixed(DecimalPrecision);
}
function CentimetreLoad(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Meter";
document.getElementById('Feet').innerHTML = ((Value/100)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Feet";
document.getElementById('Km').innerHTML = ((Value/30.48)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Kilometre";
document.getElementById('Mile').innerHTML = ((Value/100000)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "mile";
document.getElementById('Yard').innerHTML = ((Value/160934)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Yard";
document.getElementById('Inch').innerHTML = ((Value/91.44)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Inch";
document.getElementById('Centimeter').innerHTML = ((Value/2.54)).toFixed(DecimalPrecision);
}
function SQMeter(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Feet";
document.getElementById('Feet').innerHTML = ((Value * 10.764)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Yard";
document.getElementById('Km').innerHTML = ((Value / 1.196)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Hectare";
document.getElementById('Mile').innerHTML = ((Value / 10000)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Acre";
document.getElementById('Yard').innerHTML = ((Value / 4047)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Guntha";
document.getElementById('Inch').innerHTML = ((Value * 0.009884215262)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Vigha";
document.getElementById('Centimeter').innerHTML = ((Value * 0.0003953686105)).toFixed(DecimalPrecision);
}
function SQFeet(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Meter";
document.getElementById('Feet').innerHTML = ((Value / 10.764)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Yard";
document.getElementById('Km').innerHTML = ((Value/9)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Hectare";
document.getElementById('Mile').innerHTML = ((Value/107639)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Acre";
document.getElementById('Yard').innerHTML = ((Value/43560)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Guntha";
document.getElementById('Inch').innerHTML = ((Value*0.0009182736455)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Vigha";
document.getElementById('Centimeter').innerHTML = ((Value*0.00003673094582)).toFixed(DecimalPrecision);
}
function SQYard(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Meter";
document.getElementById('Feet').innerHTML = ((Value/ 1.196)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Feet";
document.getElementById('Km').innerHTML = ((Value*9)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Hectare";
document.getElementById('Mile').innerHTML = ((Value/11960)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Acre";
document.getElementById('Yard').innerHTML = ((Value/4840)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Guntha";
document.getElementById('Inch').innerHTML = ((Value*0.008264463616)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Vigha";
document.getElementById('Centimeter').innerHTML = ((Value*0.0003305785446)).toFixed(DecimalPrecision);
}
function Heq(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Meter";
document.getElementById('Feet').innerHTML = ((Value* 10000)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Feet";
document.getElementById('Km').innerHTML = ((Value*107639)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Square Yard";
document.getElementById('Mile').innerHTML = ((Value*11959.9)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Acre";
document.getElementById('Yard').innerHTML = ((Value*2.471)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Guntha";
document.getElementById('Inch').innerHTML = ((Value*98.84215262)).toFixed(DecimalPrecision) ;
document.getElementById('six').innerHTML = "Vigha";
document.getElementById('Centimeter').innerHTML = ((Value*6.18)).toFixed(DecimalPrecision);
}
function Acre(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Meter";
document.getElementById('Feet').innerHTML = ((Value* 4047)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Feet";
document.getElementById('Km').innerHTML = ((Value*43560)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Square Yard";
document.getElementById('Mile').innerHTML = ((Value*4840)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Hectare";
document.getElementById('Yard').innerHTML = ((Value/2.471)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Guntha";
document.getElementById('Inch').innerHTML = ((Value*40.00000001)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Vigha";
document.getElementById('Centimeter').innerHTML = ((Value*2.5)).toFixed(DecimalPrecision);
}
function Guntha(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Meter";
document.getElementById('Feet').innerHTML = ((Value* 101.1714105)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Feet";
document.getElementById('Km').innerHTML = ((Value*1088.9945 )).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Square Yard";
document.getElementById('Mile').innerHTML = ((Value*121)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Hectare";
document.getElementById('Yard').innerHTML = ((Value*0.01011714105)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Acre";
document.getElementById('Inch').innerHTML = ((Value*0.02499999999)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Vigha";
document.getElementById('Centimeter').innerHTML = ((Value*0.0625)).toFixed(DecimalPrecision);
}
function Vigha(){
Value = parseFloat(Value);
document.getElementById('one').innerHTML = "Square Meter";
document.getElementById('Feet').innerHTML = ((Value* 1618.7360)).toFixed(DecimalPrecision);
document.getElementById('two').innerHTML = "Square Feet";
document.getElementById('Km').innerHTML = ((Value*17423.9124)).toFixed(DecimalPrecision);
document.getElementById('three').innerHTML = "Square Yard";
document.getElementById('Mile').innerHTML = ((Value*1935.9921)).toFixed(DecimalPrecision);
document.getElementById('four').innerHTML = "Hectare";
document.getElementById('Yard').innerHTML = ((Value* 0.1619)).toFixed(DecimalPrecision);
document.getElementById('five').innerHTML = "Acre";
document.getElementById('Inch').innerHTML = ((Value* 0.4000)).toFixed(DecimalPrecision);
document.getElementById('six').innerHTML = "Guntha";
document.getElementById('Centimeter').innerHTML = ((Value* 16.0000)).toFixed(DecimalPrecision) ;
}
function CubicMtr(){
Value = parseFloat(Value);
document.getElementById('oneNew').innerHTML = "Cubic Feet";
document.getElementById('FeetNew').innerHTML = ((Value* 35.315)).toFixed(DecimalPrecision);
document.getElementById('twoNew').innerHTML = "Cubic Inch";
document.getElementById('KmNew').innerHTML = ((Value*61024)).toFixed(DecimalPrecision);
}
function CubicFeet(){
Value = parseFloat(Value);
document.getElementById('oneNew').innerHTML = "Cubic Metre";
document.getElementById('FeetNew').innerHTML = ((Value/35.315)).toFixed(DecimalPrecision);
document.getElementById('twoNew').innerHTML = "Cubic Inch";
document.getElementById('KmNew').innerHTML = ((Value*1728)).toFixed(DecimalPrecision);
}
function CubicInch(){
Value = parseFloat(Value);
document.getElementById('oneNew').innerHTML = "Cubic Metre";
document.getElementById('FeetNew').innerHTML = ((Value/61024)).toFixed(DecimalPrecision);
document.getElementById('twoNew').innerHTML = "Cubic Feet";
document.getElementById('KmNew').innerHTML = ((Value/1728)).toFixed(DecimalPrecision);
}
function SetLabelName(labelValue){
debugger
document.getElementById("labelValue").textContent = labelValue;
}
function BindDropdown(ConversionType){
debugger
$('#unit').empty();
var optionValue = "";
if(ConversionType == "Length"){
for(var i = 0;i<LengthOptionArr.length;i++){
optionValue = LengthOptionArr[i].text;
if(i != 0 ){
$('#unit').append(`<option value="${optionValue}"> ${optionValue} </option>`);
}
else{
$('#unit').append(`<option selected="selected" value="${optionValue}"> ${optionValue} </option>`);
}
}
}
if(ConversionType == "Area"){
for(var i = 0;i<AreaOptionArr.length;i++){
optionValue = AreaOptionArr[i].text;
if(i != 0 ){
$('#unit').append(`<option value="${optionValue}"> ${optionValue} </option>`);
}
else{
$('#unit').append(`<option selected="selected" value="${optionValue}"> ${optionValue} </option>`);
}
}
}
if(ConversionType == "Volume"){
for(var i = 0;i<VolumeOptionArr.length;i++){
optionValue = VolumeOptionArr[i].text;
if(i != 0 ){
$('#unit').append(`<option value="${optionValue}"> ${optionValue} </option>`);
}
else{
$('#unit').append(`<option selected="selected" value="${optionValue}"> ${optionValue} </option>`);
}
}
}
}
</script>
<!-- <div class="jumbotron" style="border-radius: 0;padding: 1rem 4rem !important; text-align: center; background: darkred; color: white; text-transform: capitalize;">
<h5 class="">civil-engineering-calculators!</h5>
</div> -->
<div class="row" style="margin-top: 15px; margin-left: 10px;margin-right: 10px;">
<div class="col-lg-5">
<div class="card">
<div style="padding: 10px; background: lavenderblush;">
<h6>Unit Conversion Calculation</h6>
</div>
<div class="card-body">
<form id="myForm">
<div class="form-group row">
<label for="inputEmail3" class="col-sm-4 col-form-label">Conversion Type </label>
<div class="col-sm-8">
<select onchange="ConversionChange()" class="custom-select" id="ConversionType">
<option selected value="Length">Length</option>
<option value="Area">Area</option>
<option value="Volume">Volume</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-4 col-form-label">Unit</label>
<div class="col-sm-8">
<select onchange="UnitChange()" class="custom-select" id="unit">
</select>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-4 col-form-label">Value</label>
<div class="col-sm-8">
<div class="input-group mb-3">
<input type="text" id="ValueTxt" value="1" class="form-control" placeholder="0" aria-label="0" aria-describedby="basic-addon2">
<div class="input-group-append">
<span class="input-group-text" id="labelValue"></span>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-4 col-form-label">Decimal Precision </label>
<div class="col-sm-8">
<input type="text" id="DecimalPrecision" value="2" class="form-control" placeholder="0" aria-label="0" aria-describedby="basic-addon2">
</div>
</div>
<div class="form-group row" style="text-align: right;">
<div class="col-sm-12 pull-right">
<button style="background-color: darkred !important;color: white;" type="button" class="btn" onclick="Calculate()">Calculate</button>
<button type="submit" onclick="FormReset()" class="btn btn-primary pull-right">Reset</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div style="padding: 10px; background: #f1edef;">
<h6>Unit Conversion</h6>
</div>
<div class="card-body" style="padding: 0 !important;">
<div style="padding: 10px;">
<div id="first">
<table class="table">
<thead>
<tr>
<th>Sr.</th> <th>Unit</th> <th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td> <td id="one"></td> <td id="Feet"></td>
</tr>
<tr>
<td>2</td> <td id="two"></td> <td id="Km"></td>
</tr>
<tr>
<td>3</td> <td id="three"></td> <td id="Mile"></td>
</tr>
<tr>
<td>4</td> <td id="four"></td> <td id="Yard"></td>
</tr>
<tr>
<td>5</td> <td id="five"></td> <td id="Inch"></td>
</tr>
<tr>
<td>6</td> <td id="six"></td> <td id="Centimeter"></td>
</tr>
</tbody>
</table>
</div>
<div id="second">
<table class="table">
<thead>
<tr>
<th>Sr.</th> <th>Unit</th> <th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td> <td id="oneNew"></td> <td id="FeetNew"></td>
</tr>
<tr>
<td>2</td> <td id="twoNew"></td> <td id="KmNew"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="col-lg-3">
<div class="card">
<div style="padding: 10px; background: #f1edef;">
<h6>Disclaimer</h6>
</div>
<div class="card-body" style="padding: 10px !important;">
The weights calculated on this steel weight calculator page are for guidance only. They are calculated using average densities for the materials. The exact composition of the material will affect the weight of the actual piece.
</div>
</div>
</div> -->
</div>
</body>
</html>