function doNfc() {
  var num = arguments[0].toString();
  var dec = num.indexOf('.');
  var rem = dec !== -1 ? num.substring(dec) : '';
  var n = dec !== -1 ? num.substring(0, dec) : num;
  n = n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
  if (arguments[1] === 0) {
    rem = '';
  }
  else if(arguments[1] !== undefined){
    if(arguments[1] > rem.length){
      rem+= dec === -1 ? '.' : '';
      var len = arguments[1] - rem.length + 1;
      for(var i =0; i< len; i++){
        rem += '0';
      }
    }
    else{
      rem = rem.substring(0, arguments[1] + 1);
    }
  }
  return n + rem;
}
Utility function for formatting numbers into strings. Similar to nf() but
puts a "+" in front of positive numbers and a "-" in front of negative
numbers. There are two versions: one for formatting floats, and one for
formatting ints. The values for left, and right parameters
should always be positive integers.

@method nfp
@param {Number} num      the Number to format
@param {Number}       [left]   number of digits to the left of the decimal
                               point
@param {Number}       [right]  number of digits to the right of the
                               decimal point
@return {String}         formatted String