Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
function divideEvenly(numerator, minPartSize) {
  console.log("numerator "+ numerator+ " mminPartSize "+ minPartSize);
  if(numerator / minPartSize < 2) {
    return [numerator];
  }
  return [minPartSize].concat(divideEvenly(numerator-minPartSize, minPartSize));
}
function divideCurrencyEvenly(numerator, divisor) {
  var minPartSize = +(numerator / divisor).toFixed(2)
  return divideEvenly(numerator*100, minPartSize*100).map(function(v) {
    return (v/100).toFixed(2);
  });
}
console.log(divideCurrencyEvenly(3856, 3));
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers