mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-02-07 12:09:18 +01:00
Truncate fractions in rounding::equivalent_fraction
This commit is contained in:
parent
66aeff3ade
commit
1b35a2ab42
@ -153,6 +153,9 @@ fn equivalent_fraction(value: f64) -> Option<String> {
|
|||||||
numer /= gcd;
|
numer /= gcd;
|
||||||
denom /= gcd;
|
denom /= gcd;
|
||||||
|
|
||||||
|
numer = numer.trunc();
|
||||||
|
denom = denom.trunc();
|
||||||
|
|
||||||
if denom <= 1f64 || denom >= 100f64 || denom == 10f64 {
|
if denom <= 1f64 || denom >= 100f64 || denom == 10f64 {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user