FileProcessor.Parsers.int

node v6.11.2
version: 1.0.0
endpointsharetweet
const parseNumber = (value, func) => { if (value === null || typeof value === 'undefined') { return null; } const result = func(value.toString().replace(/[^0-9.]+/g, ''), 10); if (isNaN(result)) { return null; } return result; }; function int(value, coefficient) { const candidate = parseNumber(value, parseInt); if (candidate === null) { return null; } return candidate * (coefficient || 1); } int('50106478, 50106479, 50106125')
Loading…

no comments

    sign in to comment