// 金インゴット var ingot_au = 13390; var ingot_au_300 = 13390 + 13; var ingot_au_200 = 13390 + 20; var ingot_au_100 = 13390 + 40; var ingot_au_50 = 13390 + 110; var ingot_au_20 = 13390 + 190; var ingot_au_10 = 13390 + 320; var ingot_au_5 = 13390 + 510; $('input[name="gold_ingot"]').val(function(){ var val = $(this).val(); var unit = 500; // 最小単位5gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_au * _num * 500; _val = _val - (_num * 500); } if (_val >= 300) { _num = Math.floor(_val / 300); price = price + ingot_au_300 * _num * 300; _val = _val - (_num * 300); } if (_val >= 200) { _num = Math.floor(_val / 200); price = price + ingot_au_200 * _num * 200; _val = _val - (_num * 200); } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_au_100 * _num * 100; _val = _val - (_num * 100); } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_au_50 * _num * 50; _val = _val - (_num * 50); } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_au_20 * _num * 20; _val = _val - (_num * 20); } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_au_10 * _num * 10; _val = _val - (_num * 10); } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_au_5 * _num * 5; _val = _val - (_num * 5); } $(this).val(val); $('.gold_ingot_total').text(number_format(Math.floor(price), 0)); }); $('input[name="gold_ingot"]').blur(function(){ var val = $(this).val(); var unit = 500; // 最小単位5gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_au * _num * 500; _val = _val - (_num * 500); } if (_val >= 300) { _num = Math.floor(_val / 300); price = price + ingot_au_300 * _num * 300; _val = _val - (_num * 300); } if (_val >= 200) { _num = Math.floor(_val / 200); price = price + ingot_au_200 * _num * 200; _val = _val - (_num * 200); } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_au_100 * _num * 100; _val = _val - (_num * 100); } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_au_50 * _num * 50; _val = _val - (_num * 50); } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_au_20 * _num * 20; _val = _val - (_num * 20); } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_au_10 * _num * 10; _val = _val - (_num * 10); } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_au_5 * _num * 5; _val = _val - (_num * 5); } $(this).val(val); $('.gold_ingot_total').text(number_format(Math.floor(price), 0)); sumPrice(); }); $('input[name="gold_ingot2"]').val(function(){ var val = $(this).val(); var unit = 5; // 最小単位5gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; var au = ingot_au_5; var flag = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_au * _num * 500; _val = _val - (_num * 500); if (flag == 0) { au = ingot_au; flag = 1; } } if (_val >= 300) { _num = Math.floor(_val / 300); price = price + ingot_au_300 * _num * 300; _val = _val - (_num * 300); if (flag == 0) { au = ingot_au_300; flag = 1; } } if (_val >= 200) { _num = Math.floor(_val / 200); price = price + ingot_au_200 * _num * 200; _val = _val - (_num * 200); if (flag == 0) { au = ingot_au_200; flag = 1; } } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_au_100 * _num * 100; _val = _val - (_num * 100); if (flag == 0) { au = ingot_au_100; flag = 1; } } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_au_50 * _num * 50; _val = _val - (_num * 50); if (flag == 0) { au = ingot_au_50; flag = 1; } } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_au_20 * _num * 20; _val = _val - (_num * 20); if (flag == 0) { au = ingot_au_20; flag = 1; } } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_au_10 * _num * 10; _val = _val - (_num * 10); if (flag == 0) { au = ingot_au_10; flag = 1; } } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_au_5 * _num * 5; _val = _val - (_num * 5); if (flag == 0) { au = ingot_au_5; flag = 1; } } $(this).val(val); $('.gold_ingot_total2').text(number_format(Math.floor(price), 0)); $('.gold_ingot_price2').text(number_format(au, 0)); }); $('input[name="gold_ingot2"]').blur(function(){ var val = $(this).val(); var unit = 5; // 最小単位5gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; var au = ingot_au_5; var flag = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_au * _num * 500; _val = _val - (_num * 500); if (flag == 0) { au = ingot_au; flag = 1; } } if (_val >= 300) { _num = Math.floor(_val / 300); price = price + ingot_au_300 * _num * 300; _val = _val - (_num * 300); if (flag == 0) { au = ingot_au_300; flag = 1; } } if (_val >= 200) { _num = Math.floor(_val / 200); price = price + ingot_au_200 * _num * 200; _val = _val - (_num * 200); if (flag == 0) { au = ingot_au_200; flag = 1; } } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_au_100 * _num * 100; _val = _val - (_num * 100); if (flag == 0) { au = ingot_au_100; flag = 1; } } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_au_50 * _num * 50; _val = _val - (_num * 50); if (flag == 0) { au = ingot_au_50; flag = 1; } } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_au_20 * _num * 20; _val = _val - (_num * 20); if (flag == 0) { au = ingot_au_20; flag = 1; } } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_au_10 * _num * 10; _val = _val - (_num * 10); if (flag == 0) { au = ingot_au_10; flag = 1; } } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_au_5 * _num * 5; _val = _val - (_num * 5); if (flag == 0) { au = ingot_au_5; flag = 1; } } $(this).val(val); $('.gold_ingot_total2').text(number_format(Math.floor(price), 0)); $('.gold_ingot_price2').text(number_format(au, 0)); sumPrice(); }); // K24板材 var k24_0 = 13425; var k24_10 = 13400; var k24_100 = 13385; var k24_500 = 13375; var k24_1000 = 13370; $('input[name="k24"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k24 = k24_0; if (val >= 1000) { price = k24_1000 * val; k24 = k24_1000; } else if (val >= 500) { price = k24_500 * val; k24 = k24_500; } else if (val >= 100) { price = k24_100 * val; k24 = k24_100; } else if (val >= 10) { price = k24_10 * val; k24 = k24_10; } else if (val >= 0) { price = k24_0 * val; k24 = k24_0; } else { price = 0; val = 0; } $(this).val(val); $('.k24_total').text(number_format(Math.floor(price), 0)); $('.k24_price').text(number_format(k24, 0)); }); $('input[name="k24"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k24 = k24_0; if (val >= 1000) { price = k24_1000 * val; k24 = k24_1000; } else if (val >= 500) { price = k24_500 * val; k24 = k24_500; } else if (val >= 100) { price = k24_100 * val; k24 = k24_100; } else if (val >= 10) { price = k24_10 * val; k24 = k24_10; } else if (val >= 0) { price = k24_0 * val; k24 = k24_0; } else { price = 0; val = 0; } $(this).val(val); $('.k24_total').text(number_format(Math.floor(price), 0)); $('.k24_price').text(number_format(k24, 0)); sumPrice(); }); // K18棒材 var k18_0 = 10111; var k18_10 = 10086; var k18_100 = 10071; var k18_500 = 10061; var k18_1000 = 10056; $('input[name="k18"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18 = k18_0; if (val >= 1000) { price = k18_1000 * val; k18 = k18_1000; } else if (val >= 500) { price = k18_500 * val; k18 = k18_500; } else if (val >= 100) { price = k18_100 * val; k18 = k18_100; } else if (val >= 10) { price = k18_10 * val; k18 = k18_10; } else if (val >= 0) { price = k18_0 * val; k18 = k18_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18_total').text(number_format(Math.floor(price), 0)); $('.k18_price').text(number_format(k18, 0)); }); $('input[name="k18"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18 = k18_0; if (val >= 1000) { price = k18_1000 * val; k18 = k18_1000; } else if (val >= 500) { price = k18_500 * val; k18 = k18_500; } else if (val >= 100) { price = k18_100 * val; k18 = k18_100; } else if (val >= 10) { price = k18_10 * val; k18 = k18_10; } else if (val >= 0) { price = k18_0 * val; k18 = k18_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18_total').text(number_format(Math.floor(price), 0)); $('.k18_price').text(number_format(k18, 0)); sumPrice(); }); // K18WG棒材 // Pd3.7% var k18wg_1_0 = 10313; var k18wg_1_10 = 10288; var k18wg_1_100 = 10273; var k18wg_1_500 = 10263; var k18wg_1_1000 = 10258; $('input[name="k18wg"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_1_0; if (val >= 1000) { price = k18wg_1_1000 * val; k18wg = k18wg_1_1000; } else if (val >= 500) { price = k18wg_1_500 * val; k18wg = k18wg_1_500; } else if (val >= 100) { price = k18wg_1_100 * val; k18wg = k18wg_1_100; } else if (val >= 10) { price = k18wg_1_10 * val; k18wg = k18wg_1_10; } else if (val >= 0) { price = k18wg_1_0 * val; k18wg = k18wg_1_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_total').text(number_format(Math.floor(price), 0)); $('.k18wg_price').text(number_format(k18wg, 0)); }); $('input[name="k18wg"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_1_0; if (val >= 1000) { price = k18wg_1_1000 * val; k18wg = k18wg_1_1000; } else if (val >= 500) { price = k18wg_1_500 * val; k18wg = k18wg_1_500; } else if (val >= 100) { price = k18wg_1_100 * val; k18wg = k18wg_1_100; } else if (val >= 10) { price = k18wg_1_10 * val; k18wg = k18wg_1_10; } else if (val >= 0) { price = k18wg_1_0 * val; k18wg = k18wg_1_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_total').text(number_format(Math.floor(price), 0)); $('.k18wg_price').text(number_format(k18wg, 0)); sumPrice(); }); // Pd10% var k18wg_2_0 = 10629; var k18wg_2_10 = 10604; var k18wg_2_100 = 10589; var k18wg_2_500 = 10579; var k18wg_2_1000 = 10574; $('input[name="k18wg_2"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_2_0; if (val >= 1000) { price = k18wg_2_1000 * val; k18wg = k18wg_2_1000; } else if (val >= 500) { price = k18wg_2_500 * val; k18wg = k18wg_2_500; } else if (val >= 100) { price = k18wg_2_100 * val; k18wg = k18wg_2_100; } else if (val >= 10) { price = k18wg_2_10 * val; k18wg = k18wg_2_10; } else if (val >= 0) { price = k18wg_2_0 * val; k18wg = k18wg_2_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_2_total').text(number_format(Math.floor(price), 0)); $('.k18wg_2_price').text(number_format(k18wg, 0)); }); $('input[name="k18wg_2"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_2_0; if (val >= 1000) { price = k18wg_2_1000 * val; k18wg = k18wg_2_1000; } else if (val >= 500) { price = k18wg_2_500 * val; k18wg = k18wg_2_500; } else if (val >= 100) { price = k18wg_2_100 * val; k18wg = k18wg_2_100; } else if (val >= 10) { price = k18wg_2_10 * val; k18wg = k18wg_2_10; } else if (val >= 0) { price = k18wg_2_0 * val; k18wg = k18wg_2_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_2_total').text(number_format(Math.floor(price), 0)); $('.k18wg_2_price').text(number_format(k18wg, 0)); sumPrice(); }); // Pd12.5% var k18wg_3_0 = 10755; var k18wg_3_10 = 10730; var k18wg_3_100 = 10715; var k18wg_3_500 = 10705; var k18wg_3_1000 = 10700; $('input[name="k18wg_3"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_3_0; if (val >= 1000) { price = k18wg_3_1000 * val; k18wg = k18wg_3_1000; } else if (val >= 500) { price = k18wg_3_500 * val; k18wg = k18wg_3_500; } else if (val >= 100) { price = k18wg_3_100 * val; k18wg = k18wg_3_100; } else if (val >= 10) { price = k18wg_3_10 * val; k18wg = k18wg_3_10; } else if (val >= 0) { price = k18wg_3_0 * val; k18wg = k18wg_3_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_3_total').text(number_format(Math.floor(price), 0)); $('.k18wg_3_price').text(number_format(k18wg, 0)); }); $('input[name="k18wg_3"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_3_0; if (val >= 1000) { price = k18wg_3_1000 * val; k18wg = k18wg_3_1000; } else if (val >= 500) { price = k18wg_3_500 * val; k18wg = k18wg_3_500; } else if (val >= 100) { price = k18wg_3_100 * val; k18wg = k18wg_3_100; } else if (val >= 10) { price = k18wg_3_10 * val; k18wg = k18wg_3_10; } else if (val >= 0) { price = k18wg_3_0 * val; k18wg = k18wg_3_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_3_total').text(number_format(Math.floor(price), 0)); $('.k18wg_3_price').text(number_format(k18wg, 0)); sumPrice(); }); // Ni var k18wg_4_0 = 10111; var k18wg_4_10 = 10086; var k18wg_4_100 = 10071; var k18wg_4_500 = 10061; var k18wg_4_1000 = 10056; $('input[name="k18wg_4"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_4_0; if (val >= 1000) { price = k18wg_4_1000 * val; k18wg = k18wg_4_1000; } else if (val >= 500) { price = k18wg_4_500 * val; k18wg = k18wg_4_500; } else if (val >= 100) { price = k18wg_4_100 * val; k18wg = k18wg_4_100; } else if (val >= 10) { price = k18wg_4_10 * val; k18wg = k18wg_4_10; } else if (val >= 0) { price = k18wg_4_0 * val; k18wg = k18wg_4_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_4_total').text(number_format(Math.floor(price), 0)); $('.k18wg_4_price').text(number_format(k18wg, 0)); }); $('input[name="k18wg_4"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var k18wg = k18wg_4_0; if (val >= 1000) { price = k18wg_4_1000 * val; k18wg = k18wg_4_1000; } else if (val >= 500) { price = k18wg_4_500 * val; k18wg = k18wg_4_500; } else if (val >= 100) { price = k18wg_4_100 * val; k18wg = k18wg_4_100; } else if (val >= 10) { price = k18wg_4_10 * val; k18wg = k18wg_4_10; } else if (val >= 0) { price = k18wg_4_0 * val; k18wg = k18wg_4_0; } else { price = 0; val = 0; } $(this).val(val); $('.k18wg_4_total').text(number_format(Math.floor(price), 0)); $('.k18wg_4_price').text(number_format(k18wg, 0)); sumPrice(); }); // プラチナインゴット var ingot_pt = 4989; var ingot_pt_100 = 4989 + 50; var ingot_pt_50 = 4989 + 80; var ingot_pt_20 = 4989 + 100; var ingot_pt_10 = 4989 + 200; var ingot_pt_5 = 4989 + 300; $('input[name="pt"]').val(function(){ var val = $(this).val(); var unit = 500; // 最小単位500gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_pt * _num * 500; _val = _val - (_num * 500); } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_pt_100 * _num * 100; _val = _val - (_num * 100); } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_pt_50 * _num * 50; _val = _val - (_num * 50); } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_pt_20 * _num * 20; _val = _val - (_num * 20); } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_pt_10 * _num * 10; _val = _val - (_num * 10); } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_pt_5 * _num * 5; _val = _val - (_num * 5); } $(this).val(val); $('.pt_total').text(number_format(Math.floor(price), 0)); }); $('input[name="pt"]').blur(function(){ var val = $(this).val(); var unit = 500; // 最小単位500gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_pt * _num * 500; _val = _val - (_num * 500); } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_pt_100 * _num * 100; _val = _val - (_num * 100); } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_pt_50 * _num * 50; _val = _val - (_num * 50); } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_pt_20 * _num * 20; _val = _val - (_num * 20); } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_pt_10 * _num * 10; _val = _val - (_num * 10); } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_pt_5 * _num * 5; _val = _val - (_num * 5); } $(this).val(val); $('.pt_total').text(number_format(Math.floor(price), 0)); sumPrice(); }); $('input[name="pt2"]').val(function(){ var val = $(this).val(); var unit = 5; // 最小単位5gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; var pt = ingot_pt_5; var flag = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_pt * _num * 500; _val = _val - (_num * 500); if (flag == 0) { pt = ingot_pt; flag = 1; } } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_pt_100 * _num * 100; _val = _val - (_num * 100); if (flag == 0) { pt = ingot_pt_100; flag = 1; } } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_pt_50 * _num * 50; _val = _val - (_num * 50); if (flag == 0) { pt = ingot_pt_50; flag = 1; } } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_pt_20 * _num * 20; _val = _val - (_num * 20); if (flag == 0) { pt = ingot_pt_20; flag = 1; } } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_pt_10 * _num * 10; _val = _val - (_num * 10); if (flag == 0) { pt = ingot_pt_10; flag = 1; } } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_pt_5 * _num * 5; _val = _val - (_num * 5); if (flag == 0) { pt = ingot_pt_5; flag = 1; } } $(this).val(val); $('.pt_total2').text(number_format(Math.floor(price), 0)); $('.pt_price2').text(number_format(pt, 0)); }); $('input[name="pt2"]').blur(function(){ var val = $(this).val(); var unit = 5; // 最小単位5gに丸める val = Math.ceil(val / unit) * unit; var _val = val; // val = parseFloat(val).toFixed(2); var price = 0; var _num = 0; var pt = ingot_pt_5; var flag = 0; if (_val >= 500) { _num = Math.floor(_val / 500); price = price + ingot_pt * _num * 500; _val = _val - (_num * 500); if (flag == 0) { pt = ingot_pt; flag = 1; } } if (_val >= 100) { _num = Math.floor(_val / 100); price = price + ingot_pt_100 * _num * 100; _val = _val - (_num * 100); if (flag == 0) { pt = ingot_pt_100; flag = 1; } } if (_val >= 50) { _num = Math.floor(_val / 50); price = price + ingot_pt_50 * _num * 50; _val = _val - (_num * 50); if (flag == 0) { pt = ingot_pt_50; flag = 1; } } if (_val >= 20) { _num = Math.floor(_val / 20); price = price + ingot_pt_20 * _num * 20; _val = _val - (_num * 20); if (flag == 0) { pt = ingot_pt_20; flag = 1; } } if (_val >= 10) { _num = Math.floor(_val / 10); price = price + ingot_pt_10 * _num * 10; _val = _val - (_num * 10); if (flag == 0) { pt = ingot_pt_10; flag = 1; } } if (_val >= 5) { _num = Math.floor(_val / 5); price = price + ingot_pt_5 * _num * 5; _val = _val - (_num * 5); if (flag == 0) { pt = ingot_pt_5; flag = 1; } } $(this).val(val); $('.pt_total2').text(number_format(Math.floor(price), 0)); $('.pt_price2').text(number_format(pt, 0)); sumPrice(); }); // Pt1000板材 var pt1000_0 = 5080; var pt1000_10 = 5055; var pt1000_100 = 5040; var pt1000_500 = 5030; var pt1000_1000 = 5025; $('input[name="pt1000"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt1000 = pt1000_0; if (val >= 1000) { price = pt1000_1000 * val; pt1000 = pt1000_1000; } else if (val >= 500) { price = pt1000_500 * val; pt1000 = pt1000_500; } else if (val >= 100) { price = pt1000_100 * val; pt1000 = pt1000_100; } else if (val >= 10) { price = pt1000_10 * val; pt1000 = pt1000_10; } else if (val >= 0) { price = pt1000_0 * val; pt1000 = pt1000_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt1000_total').text(number_format(Math.floor(price), 0)); $('.pt1000_price').text(number_format(pt1000, 0)); }); $('input[name="pt1000"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt1000 = pt1000_0; if (val >= 1000) { price = pt1000_1000 * val; pt1000 = pt1000_1000; } else if (val >= 500) { price = pt1000_500 * val; pt1000 = pt1000_500; } else if (val >= 100) { price = pt1000_100 * val; pt1000 = pt1000_100; } else if (val >= 10) { price = pt1000_10 * val; pt1000 = pt1000_10; } else if (val >= 0) { price = pt1000_0 * val; pt1000 = pt1000_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt1000_total').text(number_format(Math.floor(price), 0)); $('.pt1000_price').text(number_format(pt1000, 0)); sumPrice(); }); // Pt950棒材 // Pd var pt950_1_0 = 5105; var pt950_1_10 = 5080; var pt950_1_100 = 5065; var pt950_1_500 = 5055; var pt950_1_1000 = 5050; $('input[name="pt950"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt950 = pt950_1_0; if (val >= 1000) { price = pt950_1_1000 * val; pt950 = pt950_1_1000; } else if (val >= 500) { price = pt950_1_500 * val; pt950 = pt950_1_500; } else if (val >= 100) { price = pt950_1_100 * val; pt950 = pt950_1_100; } else if (val >= 10) { price = pt950_1_10 * val; pt950 = pt950_1_10; } else if (val >= 0) { price = pt950_1_0 * val; pt950 = pt950_1_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt950_total').text(number_format(Math.floor(price), 0)); $('.pt950_price').text(number_format(pt950, 0)); }); $('input[name="pt950"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt950 = pt950_1_0; if (val >= 1000) { price = pt950_1_1000 * val; pt950 = pt950_1_1000; } else if (val >= 500) { price = pt950_1_500 * val; pt950 = pt950_1_500; } else if (val >= 100) { price = pt950_1_100 * val; pt950 = pt950_1_100; } else if (val >= 10) { price = pt950_1_10 * val; pt950 = pt950_1_10; } else if (val >= 0) { price = pt950_1_0 * val; pt950 = pt950_1_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt950_total').text(number_format(Math.floor(price), 0)); $('.pt950_price').text(number_format(pt950, 0)); sumPrice(); }); // Ru2% var pt950_2_0 = 5090; var pt950_2_10 = 5065; var pt950_2_100 = 5050; var pt950_2_500 = 5040; var pt950_2_1000 = 5035; $('input[name="pt950_2"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt950 = pt950_2_0; if (val >= 1000) { price = pt950_2_1000 * val; pt950 = pt950_2_1000; } else if (val >= 500) { price = pt950_2_500 * val; pt950 = pt950_2_500; } else if (val >= 100) { price = pt950_2_100 * val; pt950 = pt950_2_100; } else if (val >= 10) { price = pt950_2_10 * val; pt950 = pt950_2_10; } else if (val >= 0) { price = pt950_2_0 * val; pt950 = pt950_2_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt950_2_total').text(number_format(Math.floor(price), 0)); $('.pt950_2_price').text(number_format(pt950, 0)); }); $('input[name="pt950_2"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt950 = pt950_2_0; if (val >= 1000) { price = pt950_2_1000 * val; pt950 = pt950_2_1000; } else if (val >= 500) { price = pt950_2_500 * val; pt950 = pt950_2_500; } else if (val >= 100) { price = pt950_2_100 * val; pt950 = pt950_2_100; } else if (val >= 10) { price = pt950_2_10 * val; pt950 = pt950_2_10; } else if (val >= 0) { price = pt950_2_0 * val; pt950 = pt950_2_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt950_2_total').text(number_format(Math.floor(price), 0)); $('.pt950_2_price').text(number_format(pt950, 0)); sumPrice(); }); // Ru3% var pt950_3_0 = 5085; var pt950_3_10 = 5060; var pt950_3_100 = 5045; var pt950_3_500 = 5035; var pt950_3_1000 = 5030; $('input[name="pt950_3"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt950 = pt950_3_0; if (val >= 1000) { price = pt950_3_1000 * val; pt950 = pt950_3_1000; } else if (val >= 500) { price = pt950_3_500 * val; pt950 = pt950_3_500; } else if (val >= 100) { price = pt950_3_100 * val; pt950 = pt950_3_100; } else if (val >= 10) { price = pt950_3_10 * val; pt950 = pt950_3_10; } else if (val >= 0) { price = pt950_3_0 * val; pt950 = pt950_3_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt950_3_total').text(number_format(Math.floor(price), 0)); $('.pt950_3_price').text(number_format(pt950, 0)); }); $('input[name="pt950_3"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt950 = pt950_3_0; if (val >= 1000) { price = pt950_3_1000 * val; pt950 = pt950_3_1000; } else if (val >= 500) { price = pt950_3_500 * val; pt950 = pt950_3_500; } else if (val >= 100) { price = pt950_3_100 * val; pt950 = pt950_3_100; } else if (val >= 10) { price = pt950_3_10 * val; pt950 = pt950_3_10; } else if (val >= 0) { price = pt950_3_0 * val; pt950 = pt950_3_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt950_3_total').text(number_format(Math.floor(price), 0)); $('.pt950_3_price').text(number_format(pt950, 0)); sumPrice(); }); // Pt900棒材 // Pd10% var pt900_1_0 = 5110; var pt900_1_10 = 5085; var pt900_1_100 = 5070; var pt900_1_500 = 5060; var pt900_1_1000 = 5055; $('input[name="pt900"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_1_0; if (val >= 1000) { price = pt900_1_1000 * val; pt900 = pt900_1_1000; } else if (val >= 500) { price = pt900_1_500 * val; pt900 = pt900_1_500; } else if (val >= 100) { price = pt900_1_100 * val; pt900 = pt900_1_100; } else if (val >= 10) { price = pt900_1_10 * val; pt900 = pt900_1_10; } else if (val >= 0) { price = pt900_1_0 * val; pt900 = pt900_1_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_total').text(number_format(Math.floor(price), 0)); $('.pt900_price').text(number_format(pt900, 0)); }); $('input[name="pt900"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_1_0; if (val >= 1000) { price = pt900_1_1000 * val; pt900 = pt900_1_1000; } else if (val >= 500) { price = pt900_1_500 * val; pt900 = pt900_1_500; } else if (val >= 100) { price = pt900_1_100 * val; pt900 = pt900_1_100; } else if (val >= 10) { price = pt900_1_10 * val; pt900 = pt900_1_10; } else if (val >= 0) { price = pt900_1_0 * val; pt900 = pt900_1_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_total').text(number_format(Math.floor(price), 0)); $('.pt900_price').text(number_format(pt900, 0)); sumPrice(); }); // Ru1.5% var pt900_2_0 = 5100; var pt900_2_10 = 5075; var pt900_2_100 = 5060; var pt900_2_500 = 5050; var pt900_2_1000 = 5045; $('input[name="pt900_2"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_2_0; if (val >= 1000) { price = pt900_2_1000 * val; pt900 = pt900_2_1000; } else if (val >= 500) { price = pt900_2_500 * val; pt900 = pt900_2_500; } else if (val >= 100) { price = pt900_2_100 * val; pt900 = pt900_2_100; } else if (val >= 10) { price = pt900_2_10 * val; pt900 = pt900_2_10; } else if (val >= 0) { price = pt900_2_0 * val; pt900 = pt900_2_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_2_total').text(number_format(Math.floor(price), 0)); $('.pt900_2_price').text(number_format(pt900, 0)); }); $('input[name="pt900_2"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_2_0; if (val >= 1000) { price = pt900_2_1000 * val; pt900 = pt900_2_1000; } else if (val >= 500) { price = pt900_2_500 * val; pt900 = pt900_2_500; } else if (val >= 100) { price = pt900_2_100 * val; pt900 = pt900_2_100; } else if (val >= 10) { price = pt900_2_10 * val; pt900 = pt900_2_10; } else if (val >= 0) { price = pt900_2_0 * val; pt900 = pt900_2_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_2_total').text(number_format(Math.floor(price), 0)); $('.pt900_2_price').text(number_format(pt900, 0)); sumPrice(); }); // Ru2% var pt900_3_0 = 5095; var pt900_3_10 = 5070; var pt900_3_100 = 5055; var pt900_3_500 = 5045; var pt900_3_1000 = 5040; $('input[name="pt900_3"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_3_0; if (val >= 1000) { price = pt900_3_1000 * val; pt900 = pt900_3_1000; } else if (val >= 500) { price = pt900_3_500 * val; pt900 = pt900_3_500; } else if (val >= 100) { price = pt900_3_100 * val; pt900 = pt900_3_100; } else if (val >= 10) { price = pt900_3_10 * val; pt900 = pt900_3_10; } else if (val >= 0) { price = pt900_3_0 * val; pt900 = pt900_3_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_3_total').text(number_format(Math.floor(price), 0)); $('.pt900_3_price').text(number_format(pt900, 0)); }); $('input[name="pt900_3"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_3_0; if (val >= 1000) { price = pt900_3_1000 * val; pt900 = pt900_3_1000; } else if (val >= 500) { price = pt900_3_500 * val; pt900 = pt900_3_500; } else if (val >= 100) { price = pt900_3_100 * val; pt900 = pt900_3_100; } else if (val >= 10) { price = pt900_3_10 * val; pt900 = pt900_3_10; } else if (val >= 0) { price = pt900_3_0 * val; pt900 = pt900_3_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_3_total').text(number_format(Math.floor(price), 0)); $('.pt900_3_price').text(number_format(pt900, 0)); sumPrice(); }); // Ru3% var pt900_4_0 = 5090; var pt900_4_10 = 5065; var pt900_4_100 = 5050; var pt900_4_500 = 5040; var pt900_4_1000 = 5035; $('input[name="pt900_4"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_4_0; if (val >= 1000) { price = pt900_4_1000 * val; pt900 = pt900_4_1000; } else if (val >= 500) { price = pt900_4_500 * val; pt900 = pt900_4_500; } else if (val >= 100) { price = pt900_4_100 * val; pt900 = pt900_4_100; } else if (val >= 10) { price = pt900_4_10 * val; pt900 = pt900_4_10; } else if (val >= 0) { price = pt900_4_0 * val; pt900 = pt900_4_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_4_total').text(number_format(Math.floor(price), 0)); $('.pt900_4_price').text(number_format(pt900, 0)); }); $('input[name="pt900_4"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pt900 = pt900_4_0; if (val >= 1000) { price = pt900_4_1000 * val; pt900 = pt900_4_1000; } else if (val >= 500) { price = pt900_4_500 * val; pt900 = pt900_4_500; } else if (val >= 100) { price = pt900_4_100 * val; pt900 = pt900_4_100; } else if (val >= 10) { price = pt900_4_10 * val; pt900 = pt900_4_10; } else if (val >= 0) { price = pt900_4_0 * val; pt900 = pt900_4_0; } else { price = 0; val = 0; } $(this).val(val); $('.pt900_4_total').text(number_format(Math.floor(price), 0)); $('.pt900_4_price').text(number_format(pt900, 0)); sumPrice(); }); // Pd1000板材 var pd1000_0 = 5175; var pd1000_10 = 5150; var pd1000_100 = 5135; var pd1000_500 = 5125; var pd1000_1000 = 5120; $('input[name="pd1000"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pd1000 = pd1000_0; if (val >= 1000) { price = pd1000_1000 * val; pd1000 = pd1000_1000; } else if (val >= 500) { price = pd1000_500 * val; pd1000 = pd1000_500; } else if (val >= 100) { price = pd1000_100 * val; pd1000 = pd1000_100; } else if (val >= 10) { price = pd1000_10 * val; pd1000 = pd1000_10; } else if (val >= 0) { price = pd1000_0 * val; pd1000 = pd1000_0; } else { price = 0; val = 0; } $(this).val(val); $('.pd1000_total').text(number_format(Math.floor(price), 0)); $('.pd1000_price').text(number_format(pd1000, 0)); }); $('input[name="pd1000"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var pd1000 = pd1000_0; if (val >= 1000) { price = pd1000_1000 * val; pd1000 = pd1000_1000; } else if (val >= 500) { price = pd1000_500 * val; pd1000 = pd1000_500; } else if (val >= 100) { price = pd1000_100 * val; pd1000 = pd1000_100; } else if (val >= 10) { price = pd1000_10 * val; pd1000 = pd1000_10; } else if (val >= 0) { price = pd1000_0 * val; pd1000 = pd1000_0; } else { price = 0; val = 0; } $(this).val(val); $('.pd1000_total').text(number_format(Math.floor(price), 0)); $('.pd1000_price').text(number_format(pd1000, 0)); sumPrice(); }); // Ag1000笹吹 var ag1000_0 = 165.3; var ag1000_10 = 162.3; var ag1000_100 = 161.3; var ag1000_500 = 160.3; var ag1000_1000 = 159.8; $('input[name="ag_2"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var ag1000 = ag1000_0; if (val >= 1000) { price = ag1000_1000 * val; ag1000 = ag1000_1000; } else if (val >= 500) { price = ag1000_500 * val; ag1000 = ag1000_500; } else if (val >= 100) { price = ag1000_100 * val; ag1000 = ag1000_100; } else if (val >= 10) { price = ag1000_10 * val; ag1000 = ag1000_10; } else if (val >= 0) { price = ag1000_0 * val; ag1000 = ag1000_0; } else { price = 0; val = 0; } $(this).val(val); $('.ag_2_total').text(number_format(Math.floor(price), 0)); // $('.ag_2_price').text(number_format(ag1000, 2)); $('.ag_2_price').text(ag1000); }); $('input[name="ag_2"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var ag1000 = ag1000_0; if (val >= 1000) { price = ag1000_1000 * val; ag1000 = ag1000_1000; } else if (val >= 500) { price = ag1000_500 * val; ag1000 = ag1000_500; } else if (val >= 100) { price = ag1000_100 * val; ag1000 = ag1000_100; } else if (val >= 10) { price = ag1000_10 * val; ag1000 = ag1000_10; } else if (val >= 0) { price = ag1000_0 * val; ag1000 = ag1000_0; } else { price = 0; val = 0; } $(this).val(val); $('.ag_2_total').text(number_format(Math.floor(price), 0)); // $('.ag_2_price').text(number_format(ag1000, 2)); $('.ag_2_price').text(ag1000); sumPrice(); }); // Ag925棒材 var ag925_0 = 164.3; var ag925_10 = 161.3; var ag925_100 = 160.3; var ag925_500 = 159.3; var ag925_1000 = 158.8; $('input[name="ag925"]').val(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var ag925 = ag925_0; if (val >= 1000) { price = ag925_1000 * val; ag925 = ag925_1000; } else if (val >= 500) { price = ag925_500 * val; ag925 = ag925_500; } else if (val >= 100) { price = ag925_100 * val; ag925 = ag925_100; } else if (val >= 10) { price = ag925_10 * val; ag925 = ag925_10; } else if (val >= 0) { price = ag925_0 * val; ag925 = ag925_0; } else { price = 0; val = 0; } $(this).val(val); $('.ag925_total').text(number_format(Math.floor(price), 0)); // $('.ag925_price').text(number_format(ag925, 0)); $('.ag925_price').text(ag925); }); $('input[name="ag925"]').blur(function(){ var val = $(this).val(); val = parseFloat(val).toFixed(2); var price = 0; var ag925 = ag925_0; if (val >= 1000) { price = ag925_1000 * val; ag925 = ag925_1000; } else if (val >= 500) { price = ag925_500 * val; ag925 = ag925_500; } else if (val >= 100) { price = ag925_100 * val; ag925 = ag925_100; } else if (val >= 10) { price = ag925_10 * val; ag925 = ag925_10; } else if (val >= 0) { price = ag925_0 * val; ag925 = ag925_0; } else { price = 0; val = 0; } $(this).val(val); $('.ag925_total').text(number_format(Math.floor(price), 0)); // $('.ag925_price').text(number_format(ag925, 0)); $('.ag925_price').text(ag925); sumPrice(); }); sumPrice();