jquery.animateNumber.js
function(separator, group_length, suffix) {
        separator = separator || ' ';
        group_length = group_length || 3;
        suffix = suffix || '';

        return function(now, tween) {
          var negative = now < 0,
              floored_number = Math.floor((negative ? -1 : 1) * now),
              separated_number = floored_number.toString(),
              target = $(tween.elem);

          if (separated_number.length > group_length) {
            var number_parts = extract_number_parts(separated_number, group_length);

            separated_number = remove_precending_zeros(number_parts).join(separator);
            separated_number = reverse(separated_number);
          }

          target.prop('number', now).text((negative ? '-' : '') + separated_number + suffix);
        };
      }
function(separator, group_length, suffix) {
        separator = separator || ' ';
        group_length = group_length || 3;
        suffix = suffix || '';

        return function(now, tween) {
          var negative = now < 0,
              floored_number = Math.floor((negative ? -1 : 1) * now),
              separated_number = floored_number.toString(),
              target = $(tween.elem);

          if (separated_number.length > group_length) {
            var number_parts = extract_number_parts(separated_number, group_length);

            separated_number = remove_precending_zeros(number_parts).join(separator);
            separated_number = reverse(separated_number);
          }

          target.prop('number', now).text((negative ? '-' : '') + separated_number + suffix);
        };
      }
function ( separator , group_length , suffix ) { separator = separator || ' ' ; group_length = group_length || 3 ; suffix = suffix || '' ; return function ( now , tween ) { var negative = now < 0 , floored_number = Math . floor ( ( negative ? - 1 : 1 ) * now ) , separated_number = floored_number . toString ( ) , target = $ ( tween . elem ) ; if ( separated_number . length > group_length ) { var number_parts = extract_number_parts ( separated_number , group_length ) ; separated_number = remove_precending_zeros ( number_parts ) . join ( separator ) ; separated_number = reverse ( separated_number ) ; } target . prop ( 'number' , now ) . text ( ( negative ? '-' : '' ) + separated_number + suffix ) ; } ; }
Creates numberStep handler, which format floored numbers by separating them to groups.

@example
// will animate with 1 ... 217,980 ... 95,217,980 ... 7,095,217,980
$('#world-population').animateNumber({
number: 7095217980,
numberStep: $.animateNumber.numberStepFactories.separator(',')
});
@example
// will animate with 1% ... 217,980% ... 95,217,980% ... 7,095,217,980%
$('#salesIncrease').animateNumber({
number: 7095217980,
numberStep: $.animateNumber.numberStepFactories.separator(',', 3, '%')
});

@params {String} [separator=' '] string to separate number groups
@params {String} [group_length=3] number group length
@params {String} [suffix=''] suffix to append to number
@returns {Function} numberStep-compatible function for use in animateNumber's parameters
Creates numberStep handler which format floored numbers by separating them to groups .