starship / starship

☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!

Home Page:https://starship.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory Usage Display Inaccuracy Due to Lack of Decimal Points

muhac opened this issue · comments

Feature Request

Is your feature request related to a problem? Please describe.

The current implementation of memory usage display in memory_usage.rs does not retain decimal points, leading to inaccurate results.

// Skip decimals and the space before the byte unit.
display_bytes.retain(|c| match c {
' ' => {
keep = true;
false
}
'.' => {
keep = false;
false
}
_ => keep,
});
display_bytes

My server has 1.9GiB memory, but when displayed, it only shows 1GiB.

Describe the solution you'd like

The memory usage should include decimal points for better accuracy.

Describe alternatives you've considered

It would be great to make it configurable.