@wise-old-man/utils 2.1.17 → 2.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1876,8 +1876,8 @@ const BossProps = lodash.mapValues({
1876
1876
  }, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.BOSS, measure: exports.MetricMeasure.KILLS, isMembers: 'isMembers' in props ? props.isMembers : true, minimumValue: 'minimumValue' in props ? props.minimumValue : 5 })));
1877
1877
  const ActivityProps = lodash.mapValues({
1878
1878
  [Activity.LEAGUE_POINTS]: { name: 'League Points' },
1879
- [Activity.BOUNTY_HUNTER_HUNTER]: { name: 'Bounty Hunter (Hunter)' },
1880
- [Activity.BOUNTY_HUNTER_ROGUE]: { name: 'Bounty Hunter (Rogue)' },
1879
+ [Activity.BOUNTY_HUNTER_HUNTER]: { name: 'Bounty Hunter (Hunter)', minimumValue: 2 },
1880
+ [Activity.BOUNTY_HUNTER_ROGUE]: { name: 'Bounty Hunter (Rogue)', minimumValue: 2 },
1881
1881
  [Activity.CLUE_SCROLLS_ALL]: { name: 'Clue Scrolls (All)' },
1882
1882
  [Activity.CLUE_SCROLLS_BEGINNER]: { name: 'Clue Scrolls (Beginner)' },
1883
1883
  [Activity.CLUE_SCROLLS_EASY]: { name: 'Clue Scrolls (Easy)' },
@@ -2314,13 +2314,17 @@ function formatNumber(num, withLetters = false, decimalPrecision = 2) {
2314
2314
  if ((num < 10000 && num > -10000) || !withLetters) {
2315
2315
  return num.toLocaleString();
2316
2316
  }
2317
- // < 10 million
2318
- if (num < 10000000 && num > -10000000) {
2317
+ // < 100k
2318
+ if (num < 100000 && num > -100000) {
2319
2319
  // If has no decimals, return as whole number instead (10.00k => 10k)
2320
2320
  if ((num / 1000) % 1 === 0)
2321
2321
  return `${num / 1000}k`;
2322
2322
  return `${(num / 1000).toFixed(decimalPrecision)}k`;
2323
2323
  }
2324
+ // < 10 million
2325
+ if (num < 10000000 && num > -10000000) {
2326
+ return `${Math.round(num / 1000)}k`;
2327
+ }
2324
2328
  // < 1 billion
2325
2329
  if (num < 1000000000 && num > -1000000000) {
2326
2330
  // If has no decimals, return as whole number instead (10.00m => 10m)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise-old-man/utils",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "description": "A JavaScript/TypeScript client that interfaces and consumes the Wise Old Man API, an API that tracks and measures players' progress in Old School Runescape.",
5
5
  "keywords": [
6
6
  "wiseoldman",