mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-21 06:16:45 +00:00

* Add "sweep" command to kaspawallet * minor linting & layout improvements. * contain code in "sweep" * update to sweep.go * formatting and bugs * clean up renaming of ExtractTransaction functions * Nicer formating of display * address reveiw. * one more sweeped -> swept * missed one reveiw comment. (extra mass). * remove redundant code from split function. Co-authored-by: Ori Newman <orinewman1@gmail.com>
17 lines
372 B
Go
17 lines
372 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/kaspanet/kaspad/domain/consensus/utils/constants"
|
|
)
|
|
|
|
// FormatKas takes the amount of sompis as uint64, and returns amount of KAS with 8 decimal places
|
|
func FormatKas(amount uint64) string {
|
|
res := " "
|
|
if amount > 0 {
|
|
res = fmt.Sprintf("%19.8f", float64(amount)/constants.SompiPerKaspa)
|
|
}
|
|
return res
|
|
}
|