Skip to content

Commit

Permalink
chore: add tests with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Oct 31, 2024
1 parent f898ea6 commit 8ada8b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/pages/library/utils.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,10 @@ unitToPlanck(42, 0) // 42n
unitToPlanck("100000", -6) // 0n
unitToPlanck("", 8) // 0n
unitToPlanck("invalid&#l-", 4) // 0n

// Valid when unit value is decimals + 1.
unitToPlanck("0.0001", 4) // 1n

// Invalid when units are smaller than decimals - returns zero.
unitToPlanck("0.0001", 3) // 0n
```

0 comments on commit 8ada8b3

Please sign in to comment.