mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
add leading zeros to display correct balance
This commit is contained in:
parent
7d7bac5fb6
commit
c3e632253a
@ -107,7 +107,9 @@ proc hex2Eth*(input: string): string =
|
||||
var one_eth = fromHex(Stuint[256], "DE0B6B3A7640000")
|
||||
|
||||
var (eth, remainder) = divmod(value, one_eth)
|
||||
fmt"{eth}.{remainder}"
|
||||
let leading_zeros = "0".repeat(($one_eth).len - ($remainder).len - 1)
|
||||
|
||||
fmt"{eth}.{leading_zeros}{remainder}"
|
||||
|
||||
proc validateMnemonic*(mnemonic: string): string =
|
||||
result = $libstatus.validateMnemonic(mnemonic)
|
||||
|
Loading…
x
Reference in New Issue
Block a user