{"version":3,"file":"accounting.umd.js","sources":["../lib/settings.js","../lib/unformat.js","../lib/internal/checkPrecision.js","../lib/toFixed.js","../node_modules/object-assign/index.js","../lib/internal/stripInsignificantZeros.js","../lib/formatNumber.js","../node_modules/is-string/index.js","../lib/internal/checkCurrencyFormat.js","../lib/formatMoney.js","../lib/formatColumn.js"],"sourcesContent":["/**\n * The library's settings configuration object.\n *\n * Contains default parameters for currency and number formatting\n */\nconst settings = {\n symbol: '$', // default currency symbol is '$'\n format: '%s%v', // controls output: %s = symbol, %v = value (can be object, see docs)\n decimal: '.', // decimal point separator\n thousand: ',', // thousands separator\n precision: 2, // decimal places\n grouping: 3, // digit grouping (not implemented yet)\n stripZeros: false, // strip insignificant zeros from decimal part\n fallback: 0 // value returned on unformat() failure\n};\n\nexport default settings;\n","import settings from './settings';\n\n/**\n * Takes a string/array of strings, removes all formatting/cruft and returns the raw float value\n * Alias: `accounting.parse(string)`\n *\n * Decimal must be included in the regular expression to match floats (defaults to\n * accounting.settings.decimal), so if the number uses a non-standard decimal\n * separator, provide it as the second argument.\n *\n * Also matches bracketed negatives (eg. '$ (1.99)' => -1.99)\n *\n * Doesn't throw any errors (`NaN`s become 0) but this may change in future\n *\n * ```js\n * accounting.unformat(\"£ 12,345,678.90 GBP\"); // 12345678.9\n * ```\n *\n * @method unformat\n * @for accounting\n * @param {String|Array} value The string or array of strings containing the number/s to parse.\n * @param {Number} decimal Number of decimal digits of the resultant number\n * @return {Float} The parsed number\n */\nfunction unformat(value, decimal = settings.decimal, fallback = settings.fallback) {\n // Recursively unformat arrays:\n if (Array.isArray(value)) {\n return value.map((val) => unformat(val, decimal, fallback));\n }\n\n // Return the value as-is if it's already a number:\n if (typeof value === 'number') return value;\n\n // Build regex to strip out everything except digits, decimal point and minus sign:\n const regex = new RegExp('[^0-9-(-)-' + decimal + ']', ['g']);\n const unformattedValueString =\n ('' + value)\n .replace(regex, '') // strip out any cruft\n .replace(decimal, '.') // make sure decimal point is standard\n .replace(/\\(([-]*\\d*[^)]?\\d+)\\)/g, '-$1') // replace bracketed values with negatives\n .replace(/\\((.*)\\)/, ''); // remove any brackets that do not have numeric value\n\n /**\n * Handling -ve number and bracket, eg.\n * (-100) = 100, -(100) = 100, --100 = 100\n */\n const negative = (unformattedValueString.match(/-/g) || 2).length % 2,\n absUnformatted = parseFloat(unformattedValueString.replace(/-/g, '')),\n unformatted = absUnformatted * ((negative) ? -1 : 1);\n\n // This will fail silently which may cause trouble, let's wait and see:\n return !isNaN(unformatted) ? unformatted : fallback;\n}\n\nexport default unformat;\n","/**\n * Check and normalise the value of precision (must be positive integer)\n */\nfunction _checkPrecision(val, base) {\n val = Math.round(Math.abs(val));\n return isNaN(val) ? base : val;\n}\n\nexport default _checkPrecision;\n","import _checkPrecision from './internal/checkPrecision';\nimport settings from './settings';\n\n/**\n * Implementation of toFixed() that treats floats more like decimals\n *\n * Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present\n * problems for accounting- and finance-related software.\n *\n * ```js\n * (0.615).toFixed(2); // \"0.61\" (native toFixed has rounding issues)\n * accounting.toFixed(0.615, 2); // \"0.62\"\n * ```\n *\n * @method toFixed\n * @for accounting\n * @param {Float} value The float to be treated as a decimal number.\n * @param {Number} [precision=2] The number of decimal digits to keep.\n * @return {String} The given number transformed into a string with the given precission\n */\nfunction toFixed(value, precision) {\n precision = _checkPrecision(precision, settings.precision);\n const power = Math.pow(10, precision);\n\n // Multiply up by precision, round accurately, then divide and use native toFixed():\n return (Math.round((value + 1e-8) * power) / power).toFixed(precision);\n}\n\nexport default toFixed;\n","/* eslint-disable no-unused-vars */\n'use strict';\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nmodule.exports = Object.assign || function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tsymbols = Object.getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","\nfunction _stripInsignificantZeros(str, decimal) {\n const parts = str.split(decimal);\n const integerPart = parts[0];\n const decimalPart = parts[1].replace(/0+$/, '');\n\n if (decimalPart.length > 0) {\n return integerPart + decimal + decimalPart;\n }\n\n return integerPart;\n}\n\nexport default _stripInsignificantZeros;\n","import objectAssign from 'object-assign';\n\nimport _stripInsignificantZeros from './internal/stripInsignificantZeros';\nimport settings from './settings';\nimport toFixed from './toFixed';\n\n/**\n * Format a number, with comma-separated thousands and custom precision/decimal places\n * Alias: `accounting.format()`\n *\n * Localise by overriding the precision and thousand / decimal separators\n *\n * ```js\n * accounting.formatNumber(5318008); // 5,318,008\n * accounting.formatNumber(9876543.21, { precision: 3, thousand: \" \" }); // 9 876 543.210\n * ```\n *\n * @method formatNumber\n * @for accounting\n * @param {Number} number The number to be formatted.\n * @param {Object} [opts={}] Object containing all the options of the method.\n * @return {String} The given number properly formatted.\n */\nfunction formatNumber(number, opts = {}) {\n // Resursively format arrays:\n if (Array.isArray(number)) {\n return number.map((val) => formatNumber(val, opts));\n }\n\n // Build options object from second param (if object) or all params, extending defaults:\n opts = objectAssign({},\n settings,\n opts\n );\n\n // Do some calc:\n const negative = number < 0 ? '-' : '';\n const base = parseInt(toFixed(Math.abs(number), opts.precision), 10) + '';\n const mod = base.length > 3 ? base.length % 3 : 0;\n\n // Format the number:\n const formatted = negative +\n (mod ? base.substr(0, mod) + opts.thousand : '') +\n base.substr(mod).replace(/(\\d{3})(?=\\d)/g, '$1' + opts.thousand) +\n (opts.precision > 0 ? opts.decimal + toFixed(Math.abs(number), opts.precision).split('.')[1] : '');\n\n return opts.stripZeros ? _stripInsignificantZeros(formatted, opts.decimal) : formatted;\n}\n\nexport default formatNumber;\n","'use strict';\n\nvar strValue = String.prototype.valueOf;\nvar tryStringObject = function tryStringObject(value) {\n\ttry {\n\t\tstrValue.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar strClass = '[object String]';\nvar hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\n\nmodule.exports = function isString(value) {\n\tif (typeof value === 'string') { return true; }\n\tif (typeof value !== 'object') { return false; }\n\treturn hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;\n};\n","import isString from 'is-string';\n\n/**\n * Parses a format string or object and returns format obj for use in rendering\n *\n * `format` is either a string with the default (positive) format, or object\n * containing `pos` (required), `neg` and `zero` values\n *\n * Either string or format.pos must contain \"%v\" (value) to be valid\n *\n * @method _checkCurrencyFormat\n * @for accounting\n * @param {String} [format=\"%s%v\"] String with the format to apply, where %s is the currency symbol and %v is the value.\n * @return {Object} object represnting format (with pos, neg and zero attributes)\n */\nfunction _checkCurrencyFormat(format) {\n // Format should be a string, in which case `value` ('%v') must be present:\n if (isString(format) && format.match('%v')) {\n // Create and return positive, negative and zero formats:\n return {\n pos: format,\n neg: format.replace('-', '').replace('%v', '-%v'),\n zero: format\n };\n }\n\n // Otherwise, assume format was fine:\n return format;\n}\n\nexport default _checkCurrencyFormat;\n","import objectAssign from 'object-assign';\n\nimport _checkCurrencyFormat from './internal/checkCurrencyFormat';\nimport settings from './settings';\nimport formatNumber from './formatNumber';\n\n/**\n * Format a number into currency\n *\n * Usage: accounting.formatMoney(number, symbol, precision, thousandsSep, decimalSep, format)\n * defaults: (0, '$', 2, ',', '.', '%s%v')\n *\n * Localise by overriding the symbol, precision, thousand / decimal separators and format\n *\n * ```js\n * // Default usage:\n * accounting.formatMoney(12345678); // $12,345,678.00\n *\n * // European formatting (custom symbol and separators), can also use options object as second parameter:\n * accounting.formatMoney(4999.99, { symbol: \"€\", precision: 2, thousand: \".\", decimal: \",\" }); // €4.999,99\n *\n * // Negative values can be formatted nicely:\n * accounting.formatMoney(-500000, { symbol: \"£ \", precision: 0 }); // £ -500,000\n *\n * // Simple `format` string allows control of symbol position (%v = value, %s = symbol):\n * accounting.formatMoney(5318008, { symbol: \"GBP\", format: \"%v %s\" }); // 5,318,008.00 GBP\n * ```\n *\n * @method formatMoney\n * @for accounting\n * @param {Number} number Number to be formatted.\n * @param {Object} [opts={}] Object containing all the options of the method.\n * @return {String} The given number properly formatted as money.\n */\nfunction formatMoney(number, opts = {}) {\n // Resursively format arrays:\n if (Array.isArray(number)) {\n return number.map((val) => formatMoney(val, opts));\n }\n\n // Build options object from second param (if object) or all params, extending defaults:\n opts = objectAssign({},\n settings,\n opts\n );\n\n // Check format (returns object with pos, neg and zero):\n const formats = _checkCurrencyFormat(opts.format);\n\n // Choose which format to use for this value:\n let useFormat;\n\n if (number > 0) {\n useFormat = formats.pos;\n } else if (number < 0) {\n useFormat = formats.neg;\n } else {\n useFormat = formats.zero;\n }\n\n // Return with currency symbol added:\n return useFormat\n .replace('%s', opts.symbol)\n .replace('%v', formatNumber(Math.abs(number), opts));\n}\n\nexport default formatMoney;\n","import objectAssign from 'object-assign';\nimport isString from 'is-string';\n\nimport _checkCurrencyFormat from './internal/checkCurrencyFormat';\nimport settings from './settings';\nimport formatNumber from './formatNumber';\nimport unformat from './unformat';\n\n/**\n * Format a list of numbers into an accounting column, padding with whitespace\n * to line up currency symbols, thousand separators and decimals places\n *\n * List should be an array of numbers\n *\n * Returns array of accouting-formatted number strings of same length\n *\n * NB: `white-space:pre` CSS rule is required on the list container to prevent\n * browsers from collapsing the whitespace in the output strings.\n *\n * ```js\n * accounting.formatColumn([123.5, 3456.49, 777888.99, 12345678, -5432], { symbol: \"$ \" });\n * ```\n *\n * @method formatColumn\n * @for accounting\n * @param {Array} list An array of numbers to format\n * @param {Object} [opts={}] Object containing all the options of the method.\n * @param {Object|String} [symbol=\"$\"] String with the currency symbol. For conveniency if can be an object containing all the options of the method.\n * @param {Integer} [precision=2] Number of decimal digits\n * @param {String} [thousand=','] String with the thousands separator.\n * @param {String} [decimal=\".\"] String with the decimal separator.\n * @param {String} [format=\"%s%v\"] String with the format to apply, where %s is the currency symbol and %v is the value.\n * @return {Array} array of accouting-formatted number strings of same length\n */\nfunction formatColumn(list, opts = {}) {\n if (!list) return [];\n\n // Build options object from second param (if object) or all params, extending defaults:\n opts = objectAssign({},\n settings,\n opts\n );\n\n // Check format (returns object with pos, neg and zero), only need pos for now:\n const formats = _checkCurrencyFormat(opts.format);\n\n // Whether to pad at start of string or after currency symbol:\n const padAfterSymbol = formats.pos.indexOf('%s') < formats.pos.indexOf('%v');\n\n // Store value for the length of the longest string in the column:\n let maxLength = 0;\n\n // Format the list according to options, store the length of the longest string:\n const formatted = list.map((val) => {\n if (Array.isArray(val)) {\n // Recursively format columns if list is a multi-dimensional array:\n return formatColumn(val, opts);\n }\n // Clean up the value\n val = unformat(val, opts.decimal);\n\n // Choose which format to use for this value (pos, neg or zero):\n let useFormat;\n\n if (val > 0) {\n useFormat = formats.pos;\n } else if (val < 0) {\n useFormat = formats.neg;\n } else {\n useFormat = formats.zero;\n }\n\n // Format this value, push into formatted list and save the length:\n const fVal = useFormat\n .replace('%s', opts.symbol)\n .replace('%v', formatNumber(Math.abs(val), opts));\n\n if (fVal.length > maxLength) {\n maxLength = fVal.length;\n }\n\n return fVal;\n });\n\n // Pad each number in the list and send back the column of numbers:\n return formatted.map((val) => {\n // Only if this is a string (not a nested array, which would have already been padded):\n if (isString(val) && val.length < maxLength) {\n // Depending on symbol position, pad after symbol or at index 0:\n return padAfterSymbol ?\n val.replace(opts.symbol, opts.symbol + (new Array(maxLength - val.length + 1).join(' '))) :\n (new Array(maxLength - val.length + 1).join(' ')) + val;\n }\n return val;\n });\n}\n\nexport default formatColumn;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,CAAA,IAAM,WAAW;AACf,CAAA,UAAQ,GAAR;AACA,CAAA,UAAQ,MAAR;AACA,CAAA,WAAS,GAAT;AACA,CAAA,YAAU,GAAV;AACA,CAAA,aAAW,CAAX;AACA,CAAA,YAAU,CAAV;AACA,CAAA,cAAY,KAAZ;AACA,CAAA,YAAU,CAAV;AARe,CAAA,CAAX;;;;;;;;;;;;;;;;;;;;;;;;ACmBN,CAAA,SAAS,QAAT,CAAkB,KAAlB,EAAmF;OAA1D,gEAAU,SAAS,OAAT,gBAAgD;OAA9B,iEAAW,SAAS,QAAT,gBAAmB;;;AAEjF,CAAA,MAAI,MAAM,OAAN,CAAc,KAAd,CAAJ,EAA0B;AACxB,CAAA,WAAO,MAAM,GAAN,CAAU,UAAC,GAAD;cAAS,SAAS,GAAT,EAAc,OAAd,EAAuB,QAAvB;MAAT,CAAjB,CADwB;IAA1B;;;AAFiF,CAAA,MAO7E,OAAO,KAAP,KAAiB,QAAjB,EAA2B,OAAO,KAAP,CAA/B;;;AAPiF,CAAA,MAU3E,QAAQ,IAAI,MAAJ,CAAW,eAAe,OAAf,GAAyB,GAAzB,EAA8B,CAAC,GAAD,CAAzC,CAAR,CAV2E;AAWjF,CAAA,MAAM,yBACF,CAAC,KAAK,KAAL,CAAD,CACC,OADD,CACS,KADT,EACgB,EADhB;IAEC,OAFD,CAES,OAFT,EAEkB,GAFlB;IAGC,OAHD,CAGS,wBAHT,EAGmC,KAHnC;IAIC,OAJD,CAIS,UAJT,EAIqB,EAJrB,CADE;;;;;;AAX2E,CAAA,MAsB3E,WAAW,CAAC,uBAAuB,KAAvB,CAA6B,IAA7B,KAAsC,CAAtC,CAAD,CAA0C,MAA1C,GAAmD,CAAnD;OACf,iBAAiB,WAAW,uBAAuB,OAAvB,CAA+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