var target = 20;
var decimal = 0;
var result = '';
var desult = '';
var base = 32;
var arr = [
'0','1','2','3','4','5','6','7','8',
'9','a','b','c','d','e','f','g','h',
'i','j','k','l','m','n','o','p','q',
'r','s','t','u','v'
];
if(String(target).includes('.')){
var temp = String(target).split('.');
target = Number(temp[0]);
decimal = Number(temp[1]) / Math.pow(10 ,temp[1].length);
}
while (target / base > 0) {
if(target % base >= 10){
result = arr[Number(target % base)] + result;
}else{
result = target % base + result;
}
target = Math.floor(target / base);
}
if(decimal){
for(var i = 0; i < 10; i++){
if(decimal * base == 1){
desult = 1;
break;
}else{
var temp = String(decimal * base).split('.');
desult += Number(temp[0]) >= 10 ? arr[Number(temp[0])] : Number(temp[0]);
decimal = Number(temp[1]) / Math.pow(10 ,temp[1].length);
}
}
}
console.log(desult ? `${result}.${desult}` : result);
console