...
This commit is contained in:
@@ -244,6 +244,10 @@ static R rad2sxg(double ang, bool hms = false, int prec = 2)
|
||||
term *= 10.0;
|
||||
}
|
||||
|
||||
// round to given precision of arcseconds/seconds
|
||||
degs = std::round(degs * 3600.0 * term) / term / 3600.0;
|
||||
|
||||
|
||||
auto d = std::trunc(degs);
|
||||
auto s = (degs - d) * 60.0;
|
||||
auto m = std::trunc(s);
|
||||
@@ -261,7 +265,9 @@ static R rad2sxg(double ang, bool hms = false, int prec = 2)
|
||||
}
|
||||
|
||||
if (ang < 0) {
|
||||
std::ranges::copy(std::string_view("-"), std::back_inserter(res));
|
||||
if (!isEqual(d, 0.0) || !isEqual(m, 0.0) || !isEqual(s, 0.0)) {
|
||||
std::ranges::copy(std::string_view("-"), std::back_inserter(res));
|
||||
}
|
||||
}
|
||||
|
||||
std::vformat_to(std::back_inserter(res), std::string_view{fmt.begin(), fmt.end()}, std::make_format_args(d, m, s));
|
||||
|
||||
Reference in New Issue
Block a user