mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
fix(memory): improve code readability
This commit is contained in:
parent
56e46c208f
commit
75c357a7f0
|
@ -22,8 +22,10 @@ func (n *memory) enabled() bool {
|
|||
}
|
||||
|
||||
func (n *memory) string() string {
|
||||
newText := strconv.FormatFloat(100.0/float64(n.TotalMemory)*float64(n.TotalMemory-n.FreeMemory), 'f', n.props.getInt(Precision, 0), 64)
|
||||
return newText
|
||||
// 100.0 / total * used
|
||||
percentage := 100.0 / float64(n.TotalMemory) * float64(n.TotalMemory-n.FreeMemory)
|
||||
text := strconv.FormatFloat(percentage, 'f', n.props.getInt(Precision, 0), 64)
|
||||
return text
|
||||
}
|
||||
|
||||
func (n *memory) init(props *properties, env environmentInfo) {
|
||||
|
|
Loading…
Reference in a new issue