Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/pipes/src/balClaimNumber.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ describe('balClaimNumber', () => {
test('should format claimcenter claim number with zeros correctly', () => {
expect(balClaimNumber(400045678020)).toBe('4.45678.2.0')
})
test('should format claimcenter claim number with zeros correctly', () => {
expect(balClaimNumber(100000000000)).toBe('1.0.0.0')
})
})
3 changes: 2 additions & 1 deletion packages/pipes/src/balClaimNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ function handleClaimCenterClaimNumber(value: string): string {
}

function removeLeadingZeros(str: string): string {
return str.replace(/^0+/, '')
const formatedValue = str.replace(/^0+/, '')
return formatedValue.length == 0 ? '0' : formatedValue
}