Truncates consumables value to the first decimal place

This commit is contained in:
Snowram 2021-06-15 19:36:20 +02:00
parent ad92d4deb0
commit 84080607cd

View File

@ -116,13 +116,13 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> String {
let buff_desc = match buff.kind {
BuffKind::Saturation | BuffKind::Regeneration | BuffKind::Potion => i18n
.get("buff.stat.health")
.replace("{str_total}", &str_total.to_string()),
.replace("{str_total}", &*format!("{:.1}", &str_total)),
BuffKind::IncreaseMaxEnergy => i18n
.get("buff.stat.increase_max_stamina")
.replace("{strength}", &strength.to_string()),
.replace("{strength}", &*format!("{:.1}", &strength)),
BuffKind::IncreaseMaxHealth => i18n
.get("buff.stat.increase_max_health")
.replace("{strength}", &strength.to_string()),
.replace("{strength}", &*format!("{:.1}", &strength)),
BuffKind::Invulnerability => i18n.get("buff.stat.invulnerability").to_string(),
BuffKind::Bleeding
| BuffKind::Burning