mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-31 08:59:15 +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;
|
||||
denom /= gcd;
|
||||
|
||||
numer = numer.trunc();
|
||||
denom = denom.trunc();
|
||||
|
||||
if denom <= 1f64 || denom >= 100f64 || denom == 10f64 {
|
||||
return None;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user