parent
b0a9a9ab06
commit
6fd68c10f3
|
@ -88,6 +88,10 @@ proc startWallet*(watchNewBlocks: bool) =
|
||||||
|
|
||||||
proc hex2Token*(input: string, decimals: int): string =
|
proc hex2Token*(input: string, decimals: int): string =
|
||||||
var value = fromHex(Stuint[256], input)
|
var value = fromHex(Stuint[256], input)
|
||||||
|
|
||||||
|
if decimals == 0:
|
||||||
|
return fmt"{value}"
|
||||||
|
|
||||||
var p = u256(10).pow(decimals)
|
var p = u256(10).pow(decimals)
|
||||||
var i = value.div(p)
|
var i = value.div(p)
|
||||||
var r = value.mod(p)
|
var r = value.mod(p)
|
||||||
|
|
Loading…
Reference in New Issue