Small refactoring of new ratio (resolves #14)
This commit is contained in:
1 parent
23d44c1b4a
commit
17e6b0d75d
6 files changed
+31
-19
No files matched your search
@@ -31,12 +31,14 @@ constexpr auto ratio_text()
|
||||
{
|
||||
if constexpr(Ratio::num != 1 || Ratio::den != 1 || Ratio::exp != 0) {
|
||||
auto txt = basic_fixed_string("[") + regular<Ratio::num>();
|
||||
if constexpr(Ratio::den == 1 && Ratio::exp == 0) {
|
||||
return txt + basic_fixed_string("]");
|
||||
}
|
||||
else if constexpr (Ratio::den == 1) {
|
||||
return txt + basic_fixed_string(" \u00D7 10") + superscript<Ratio::exp>() +
|
||||
basic_fixed_string("]");
|
||||
if constexpr(Ratio::den == 1) {
|
||||
if constexpr(Ratio::exp == 0) {
|
||||
return txt + basic_fixed_string("]");
|
||||
}
|
||||
else {
|
||||
return txt + basic_fixed_string(" \u00D7 10") + superscript<Ratio::exp>() +
|
||||
basic_fixed_string("]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
return txt + basic_fixed_string("/") + regular<Ratio::den>() +
|
||||
|
||||
Reference in new issue
Block a user