use "Earths" as unit for Jupiter/Sun (instead of Suns)

This commit is contained in:
yuni 2024-11-30 00:56:06 +01:00
parent ed75c225e4
commit 2310fdf83d

View file

@ -159,9 +159,7 @@ pub fn readable_speed(speed: f64) -> String {
/// Unit: kg
pub fn readable_mass(value: f64) -> String {
if value > SOL_MASS * 0.0001 {
return format!("{:.5} Suns", value / SOL_MASS);
} else if value > EARTH_MASS * 0.0001 {
if value > EARTH_MASS * 0.0001 {
return format!("{:.5} Earths", value / EARTH_MASS);
} else if value > 1e6 {
return format!("{value:.2e} kg").replace("e", " x 10^");