Redondeo a decena 4

Este es un ejemplo, que demuestra, por qué no es buena idea utilizar cadenas para realizar el redondeo.

HTML

<h2>
Method 4. Why not use strings to rounding
</h2>

<table>
    <tr id="data">
        <th>Results</th>
    </tr>
</table>

<p>
    <a href="https://jsfiddle.net/juglan/zw2t938c/">Method 1</a> |
    <a href="https://jsfiddle.net/juglan/h7qyfbtg/">Method 2</a> |
	<a href="https://jsfiddle.net/juglan/u8ss5n16/">Method 3</a>
</p>

CSS

* {
    font-family: Tahoma, Arial, Verdana;
}

td,
th {
    border: 1px solid #666;
    padding: 4px 8px;
}

th {
    background-color: #E0E0E0;
}

table {
    border-collapse: collapse;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h2 {
    font-size: 18px;
}

JavaScript

function round(value) {
    return parseInt(('' + value).slice(0, -1) + '0');
}

function addResult(value, row, last) {
    var node = document.createElement(last ? 'th' : 'td'),
        textnode = document.createTextNode(value);

    node.appendChild(textnode);
    row.appendChild(node);
}

function test() {
    var roundTime = 0,
        row = document.getElementById('data'),
        lap, startTime, i, endTime, currentResult;

    for (lap = 0; lap < 10; ++lap) {
        startTime = new Date();
        for (i = 0; i < 10000000; ++i) {
            round(-5000000 + i);
        }
        endTime = new Date();

        currentResult = endTime.getTime() - startTime.getTime()
        roundTime += currentResult;
        addResult(currentResult, row, false);
    }

    addResult((roundTime / 10) + 'ms', row, true);
}

test();