HTML
<p>나누기</p>
<div id="result"></div>
<p>몫</p>
<div id="result2"></div>
<p>나머지</p>
<div id="result3"></div>
js
var totalPoint = 100500;
var result = 0;
result = totalPoint / 10000;
document.getElementById('result').innerHTML = result;
result = parseInt(totalPoint / 10000);
document.getElementById('result2').innerHTML = result;
result = totalPoint % 10000;
document.getElementById('result3').innerHTML = result;
demo link : https://jsfiddle.net/qp3yw15u/4/
'js' 카테고리의 다른 글
[javascript] ++ 연산자 (0) | 2019.01.25 |
---|---|
[javascript] JSON datetime string to javascript date format yyyy-MM-dd hh:mm:ss (0) | 2018.02.28 |
[javascript] Uncaught TypeError: is not a function (0) | 2018.01.10 |
[jquery] how to get custom attribute value (0) | 2017.12.29 |
[javascript] get parameters to object (0) | 2017.12.28 |