Skip to content

Commit

Permalink
amount fallback value
Browse files Browse the repository at this point in the history
  • Loading branch information
rajranjan0608 committed Sep 29, 2022
1 parent f3612ad commit 0e6bec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/components/FaucetForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ const FaucetForm = (props: any) => {
}
}

function calculateBaseUnit(amount: string, decimals: number = 18): BigInt {
function calculateBaseUnit(amount: string = "0", decimals: number = 18): BigInt {
for(let i = 0; i < decimals; i++) {
amount += "0"
}
return BigInt(amount)
}

function calculateLargestUnit(amount: string, decimals: number = 18): string {
function calculateLargestUnit(amount: string = "0", decimals: number = 18): string {
let base = "1"
for(let i = 0; i < decimals; i++) {
base += "0"
Expand Down

0 comments on commit 0e6bec4

Please sign in to comment.