[util] Improve scientific notation handling in js_to_json (closes #14789)