Skip to content

Commit

Permalink
add edgecase
Browse files Browse the repository at this point in the history
  • Loading branch information
namgold committed Sep 12, 2023
1 parent 8592f09 commit 3978b09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/tests/numbers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ describe('formatDisplayNumber tests', () => {
test('format number 123456789123456789 correctly', () => {
expect(formatDisplayNumber(123456789123456789, { significantDigits: 18 })).toBe('123,456,789,123,456,780')
})
test('format number 1234567891234567891 correctly', () => {
expect(formatDisplayNumber(1234567891234567891, { significantDigits: 18 })).toBe('1,234,567.891234568T')
})
})
})
describe('small numbers', () => {
Expand Down Expand Up @@ -508,7 +511,10 @@ describe('formatDisplayNumber tests', () => {
expect(formatDisplayNumber('123456789', { significantDigits: 18 })).toBe('123,456,789')
})
test('format string 123456789123456789 correctly', () => {
expect(formatDisplayNumber('123456789123456789', { significantDigits: 6 })).toBe('123,457T')
expect(formatDisplayNumber('123456789123456789', { significantDigits: 18 })).toBe('123,456,789,123,456,780')
})
test('format string 1234567891234567891 correctly', () => {
expect(formatDisplayNumber('1234567891234567891', { significantDigits: 18 })).toBe('1,234,567.891234568T')
})
})
})
Expand Down

0 comments on commit 3978b09

Please sign in to comment.