Skip to content

Commit

Permalink
Fix ideal unit: Light year (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcomte authored Jul 10, 2023
1 parent e4ccc60 commit 2626ea5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ pub fn to_ideal_unit(number: Number) -> Number {
let value = number.value * number.unit.weight();
if number.unit.category() == Length {
if value >= d128!(1000000000000000000) { // ≈ 0.1 light years
return Number::new(value/Kilometer.weight(), Kilometer)
return Number::new(value/LightYear.weight(), LightYear)
} else if value >= d128!(1000000) { // 1 km
return Number::new(value/Kilometer.weight(), Kilometer)
} else if value >= d128!(1000) { // 1 m
Expand Down

0 comments on commit 2626ea5

Please sign in to comment.