I first didn't want to answer, as Pointys solution seems far more elegant.
But after doing a Jsperf it turned out the Math solution was about 70% slower for me on chrome.
function cnvrt3 (n) {
return n / Math.pow(10,(""+n).length)
}
cnvrt3(132232)//0.132232
So heres the same using casting to determine the power of ten
Note due to the floating point precision 0.132232 is not really 0.132232
. Though most likely the value you are looking for