src/numeric-directive.js
function numberWithCommas(value) {
                if (formatting) {
                    var parts = (""+value).split(decimalSeparator);
                    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
                    return parts.join(decimalSeparator);
                }
                else {
                    // No formatting applies.
                    return value;
                }
            }
function numberWithCommas(value) {
                if (formatting) {
                    var parts = (""+value).split(decimalSeparator);
                    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
                    return parts.join(decimalSeparator);
                }
                else {
                    // No formatting applies.
                    return value;
                }
            }
function numberWithCommas ( value ) { if ( formatting ) { var parts = ( "" + value ) . split ( decimalSeparator ) ; parts [ 0 ] = parts [ 0 ] . replace ( / \B(?=(\d{3})+(?!\d)) / g , groupSeparator ) ; return parts . join ( decimalSeparator ) ; } else { // No formatting applies. return value ; } }
Format a number with the thousand group separator.
Format a number with the thousand group separator .