{"version":3,"sources":["../src/round.ts","../src/roundToString.ts"],"sourcesContent":["/**\n * Simplifies rounding of floating point numbers. Note that if your number ends\n * with zeros, and you convert the number to string, you will lose the zeroes\n * at the end. To show the exact number of decimal places, you'll need to use\n * roundToString() or toFixed(). E.g. round(1.20, 2).toFixed(2).\n */\nexport function round(n: number, numDecimalPlaces = 0): number {\n  const multipler = Math.pow(10, numDecimalPlaces);\n  return Math.round(n * multipler) / multipler;\n}\n","import { round } from \"./round\";\n\n/**\n * Returns a string with the number in the exact number of decimal places\n * specified, in case the number ends with zeroes, and adding commas for each\n * group of 3 significant digits.\n */\nexport function roundToString(n: number, numDecimalPlaces = 0): string {\n  return round(n, numDecimalPlaces).toLocaleString(\"en-US\", {\n    minimumFractionDigits: numDecimalPlaces,\n    maximumFractionDigits: numDecimalPlaces,\n  });\n}\n"],"mappings":"AAMO,SAASA,EAAM,EAAWC,EAAmB,EAAW,CAC7D,IAAMC,EAAY,KAAK,IAAI,GAAID,CAAgB,EAC/C,OAAO,KAAK,MAAM,EAAIC,CAAS,EAAIA,CACrC,CCFO,SAASC,EAAc,EAAWC,EAAmB,EAAW,CACrE,OAAOC,EAAM,EAAGD,CAAgB,EAAE,eAAe,QAAS,CACxD,sBAAuBA,EACvB,sBAAuBA,CACzB,CAAC,CACH","names":["round","numDecimalPlaces","multipler","roundToString","numDecimalPlaces","round"]}