forked from mpusz/mp-units
include what we use and use system header syntax
don't show 10^0 when den != 0
This commit is contained in:
committed by
Mateusz Pusz
parent
424f0512c1
commit
ef862c9f69
@@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "units/bits/deduced_symbol_text.h"
|
#include <units/bits/deduced_symbol_text.h>
|
||||||
#include "units/bits/external/text_tools.h"
|
#include <units/bits/external/text_tools.h>
|
||||||
#include "units/prefix.h"
|
#include <units/prefix.h>
|
||||||
#include <units/derived_dimension.h>
|
#include <units/derived_dimension.h>
|
||||||
|
|
||||||
namespace units::detail {
|
namespace units::detail {
|
||||||
@@ -47,9 +47,15 @@ constexpr auto ratio_text()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return txt + basic_fixed_string("/") + regular<Ratio::den>() +
|
if constexpr(Ratio::exp == 0) {
|
||||||
basic_fixed_string(" \u00D7 10") + superscript<Ratio::exp>() +
|
return txt + basic_fixed_string("/") + regular<Ratio::den>() +
|
||||||
basic_fixed_string("] ");
|
basic_fixed_string("] ");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return txt + basic_fixed_string("/") + regular<Ratio::den>() +
|
||||||
|
basic_fixed_string(" \u00D7 10") + superscript<Ratio::exp>() +
|
||||||
|
basic_fixed_string("] ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user