static thousandSeparator(val) {
      const values = val.split(".");
      const valLength = values[0].length;
      const a = (valLength / 3);
      let b = Math.floor(valLength / 3);

      if ((a >= 1 && a > b) || (a >= 1 && a === b)) {
        if (a === b) b -= 1;
        let end = valLength;
        let start = 0;
        let str = "";
        for (let x = 0; x < b; x += 1) {
          start = end - 3;
          str = `,${values[0].substring(start, end)}${str}`;
          end -= 3;
        }
        if (b > 0) values[0] = values[0].substring(0, start) + str;
      }

      return values.join(".");
    }
/**
     * Add thousand separator (,) to string of numbers greater than or equals a thousand.
     * @param {String} val String of number to add the thousand separator.
     * @returns {String}
     */
Add thousand separator (,) to string of numbers greater than or equals a thousand.
@param {String} val String of number to add the thousand separator.
@returns {String}
Add thousand separator ( ) to string of numbers greater than or equals a thousand . @param { String } val String of number to add the thousand separator . @returns { String }
static thousandSeparator(val) {
      const values = val.split(".");
      const valLength = values[0].length;
      const a = (valLength / 3);
      let b = Math.floor(valLength / 3);
      if ((a >= 1 && a > b) || (a >= 1 && a === b)) {
        if (a === b) b -= 1;
        let end = valLength;
        let start = 0;
        let str = "";
        for (let x = 0; x < b; x += 1) {
          start = end - 3;
          str = `,${values[0].substring(start, end)}${str}`;
          end -= 3;
        }
        if (b > 0) values[0] = values[0].substring(0, start) + str;
      }
      return values.join(".");
    }
static thousandSeparator ( val ) { const values = val . split ( "." ) ; const valLength = values [ 0 ] . length ; const a = ( valLength / 3 ) ; let b = Math . floor ( valLength / 3 ) ; if ( ( a >= 1 && a > b ) || ( a >= 1 && a === b ) ) { if ( a === b ) b -= 1 ; let end = valLength ; let start = 0 ; let str = "" ; for ( let x = 0 ; x < b ; x += 1 ) { start = end - 3 ; str = ` ${ values [ 0 ] . substring ( start , end ) } ${ str } ` ; end -= 3 ; } if ( b > 0 ) values [ 0 ] = values [ 0 ] . substring ( 0 , start ) + str ; } return values . join ( "." ) ; }
Add thousand separator (,) to string of numbers greater than or equals a thousand.
Add thousand separator ( ) to string of numbers greater than or equals a thousand .