'JSformat' the bpm float

This commit is contained in:
Natsu Kagami 2020-08-09 23:19:06 -04:00
parent 84e192b050
commit 939937a996
No known key found for this signature in database
GPG key ID: F17543D4B9424B94

View file

@ -131,6 +131,7 @@ impl Difficulty {
_ => true, _ => true,
}; };
let three_lines = is_not_ranked; let three_lines = is_not_ranked;
let bpm = (self.bpm * 100.0).round() / 100.0;
MessageBuilder::new() MessageBuilder::new()
.push(format!( .push(format!(
"[[Link]]({}) (`{}`)", "[[Link]]({}) (`{}`)",
@ -161,7 +162,7 @@ impl Difficulty {
.push_bold(format!("{:.1}", self.od)) .push_bold(format!("{:.1}", self.od))
.push(", HP") .push(", HP")
.push_bold(format!("{:.1}", self.hp)) .push_bold(format!("{:.1}", self.hp))
.push(format!(", BPM**{}**", self.bpm)) .push(format!(", BPM**{}**", bpm))
.push(", ⌛ ") .push(", ⌛ ")
.push_bold(format!("{}", YoumuDuration(self.drain_length))) .push_bold(format!("{}", YoumuDuration(self.drain_length)))
.build() .build()