• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DaniSomoza / galactic-commander / 12444891208

21 Dec 2024 11:46AM UTC coverage: 52.036% (-13.6%) from 65.587%
12444891208

Pull #11

github

web-flow
Merge 9b5ea0e56 into 4f9f087f0
Pull Request #11: Build units

206 of 789 branches covered (26.11%)

Branch coverage included in aggregate %.

366 of 898 new or added lines in 85 files covered. (40.76%)

10 existing lines in 7 files now uncovered.

1417 of 2330 relevant lines covered (60.82%)

3.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.25
/packages/frontend/src/utils/formatNumber.ts
1
const formatterWithoutDecimal = new Intl.NumberFormat('es-ES', {
1✔
2
  style: 'decimal',
3
  maximumFractionDigits: 0
4
})
5

6
const formatter = new Intl.NumberFormat('es-ES', {
1✔
7
  style: 'decimal',
8
  maximumFractionDigits: 2
9
})
10

11
// TODO: use a object as a parameter
12
function formatNumber(amount: number, showFullAmount = false): string {
×
13
  if (showFullAmount) {
1!
14
    return formatterWithoutDecimal.format(amount)
1✔
15
  }
16

UNCOV
17
  if (amount > 1_000_000) {
×
18
    return `${formatter.format(amount / 1_000_000)}M`
×
19
  }
20

UNCOV
21
  if (amount > 1_000) {
×
22
    return `${formatter.format(amount / 1_000)}K`
×
23
  }
24

UNCOV
25
  return formatterWithoutDecimal.format(amount)
×
26
}
27

28
export default formatNumber
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc