comparison index.html @ 11:1b8c5c3afaf5

Round up
author nanaya <me@myconan.net>
date Fri, 17 Jun 2016 10:36:02 +0900
parents bc14e1e8d046
children 13d740477326
comparison
equal deleted inserted replaced
10:bc14e1e8d046 11:1b8c5c3afaf5
111 var displayResult = function() { 111 var displayResult = function() {
112 if (rates.fixer === undefined || rates.bni === undefined) { return; } 112 if (rates.fixer === undefined || rates.bni === undefined) { return; }
113 var x = input(); 113 var x = input();
114 114
115 $("#rate-text").text(rates.fixer.toLocaleString()); 115 $("#rate-text").text(rates.fixer.toLocaleString());
116 $("#result-bank").text((Math.round(x * 1.07 * rates.fixer / 1000) * 1000).toLocaleString()); 116 $("#result-bank").text((Math.ceil(x * 1.07 * rates.fixer / 1000) * 1000).toLocaleString());
117 117
118 if (rates.bni !== 0) { 118 if (rates.bni !== 0) {
119 $("#rate-text-bni").text(rates.bni.toLocaleString()); 119 $("#rate-text-bni").text(rates.bni.toLocaleString());
120 $("#result-bank-bni").text((Math.ceil(x * 1.02 * rates.bni / 1000) * 1000 + 25000).toLocaleString()); 120 $("#result-bank-bni").text((Math.ceil(x * 1.02 * rates.bni / 1000) * 1000 + 25000).toLocaleString());
121 } else { 121 } else {