Print fractions (like FPS) in a better way, especially if denominator is 1

This commit is contained in:
N00MKRAD
2023-12-21 19:06:31 +01:00
parent 058820bc8e
commit 5da083bf2c
4 changed files with 25 additions and 14 deletions

View File

@@ -46,7 +46,6 @@ namespace Flowframes.Data
Numerator = (value * 10000f).RoundToInt();
Denominator = 10000;
this = GetReduced();
Logger.Log($"Converted float {value} to Fraction {this}", true);
}
public Fraction(string text)
@@ -71,7 +70,7 @@ namespace Flowframes.Data
}
}
Logger.Log($"Fraction from String: Fraction(\"{text}\") => {Numerator}/{Denominator}", true);
Console.WriteLine($"Fraction from String: Fraction(\"{text}\") => {Numerator}/{Denominator}", true);
}
private static long GetGreatestCommonDenominator(long a, long b)