mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-25 20:21:44 +02:00
Truncate fractions in rounding::equivalent_fraction
This commit is contained in:
parent
5c0b7e118b
commit
3f4cfd9359
@ -153,6 +153,9 @@ fn equivalent_fraction(value: f64) -> Option<String> {
|
||||
numer /= gcd;
|
||||
denom /= gcd;
|
||||
|
||||
numer = numer.trunc();
|
||||
denom = denom.trunc();
|
||||
|
||||
if denom <= 1f64 || denom >= 100f64 || denom == 10f64 {
|
||||
return None;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user