DRY out engineering notation implementation
<p>This my code:</p>

<pre><code>function engineeringNotation(number) {
    var space = '&amp;thinsp;';

    // Giga
    if(number &gt;= 1e10)
        return (number / 1e9).toFixed(1) + space + 'G';
    else if(number &gt;= 1e9)
        return (number / 1e8).toFixed(0) / 10 + space + 'G';

    // Mega
    else if(number &gt;= 1e7)
        return (number / 1e6).toFixed(1) + space + 'M';
    else if(number &gt;= 1e6)
        return (number / 1e5).toFixed(0) / 10 + space + 'M';

    // Kilo
    else if(number &gt;= 1e4)
        return (number / 1e3).toFixed(1) + space + 'k';
    else if(number &gt;= 1e3)
        return (number / 1e2).toFixed(0) / 10 + space + 'k';

    // Unit
    else if(number &gt;= 1e1)
        return (number / 1e0).toFixed(0) + space + '';
    else
        return (number / 1e-1).toFixed(0) / 10 + space + '';
}
</code></pre>

<p>Basically, it takes a number, and returns it in "engineering notation" to one decimal place. For example, <code>1234</code> becomes <code>1.2 k</code>. I feel I'm repeating myself a lot. Can the above code be improved and DRYed out?</p>
