mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Use SI prefixes as suffixes for shortening item quantities shown in slots, to prevent the quantity associated with large stacks from overflowing into adjacent grid cells.
This commit is contained in:
parent
7f06607899
commit
2c7a9d1a7a
@ -698,7 +698,12 @@ where
|
||||
|
||||
// Draw amount
|
||||
if let Some(amount) = amount {
|
||||
let amount = format!("{}", &amount);
|
||||
let amount = match amount {
|
||||
amount if amount > 1_000_000_000 => format!("{}G", amount / 1_000_000_000),
|
||||
amount if amount > 1_000_000 => format!("{}M", amount / 1_000_000),
|
||||
amount if amount > 1_000 => format!("{}K", amount / 1_000),
|
||||
amount => format!("{}", amount),
|
||||
};
|
||||
// Text shadow
|
||||
Text::new(&amount)
|
||||
.font_id(amount_font)
|
||||
|
Loading…
Reference in New Issue
Block a user