function parseHeuristic(value) {
  if (value.match(/[0-9., ]/g)) {
    // 1. put placeholder at decimal separator
    const numberString = value
      .replace(/(,|\.)([^,|.]*)$/g, '_decSep_$2')
      .replace(/(,|\.| )/g, '') // 2. remove all group separators
      .replace(/_decSep_/, '.'); // 3. restore decimal separator
    return parseFloat(numberString);
  }
  return 0;
}
Parses numbers by considering all separators.
It only keeps the last separator and uses it as decimal separator.

Warning: This function works only with numbers that can be heuristically parsed.

@param {string} value Number that can be heuristically parsed
@return {number} parsed javascript number