UNPKG

@beenotung/tslib

Version:
14 lines (13 loc) 375 B
"use strict"; /** * Created by beenotung on 4/23/17. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.fromLocaleString = fromLocaleString; function fromLocaleString(str) { const num = +str.replaceAll(',', ''); if (num.toLocaleString() === str) { return num; } throw new Error('failed to parse locale string into number'); }