Closed
Description
openedon Feb 26, 2020
Adstring outputs the wrong string when dec starts with negative zero (i.e. -0.5), while radec converts correctly.
>> adstring(15, -0.5)
" 01 00 00.0 +00 30 00"
>> radec(15, -0.5)
(1.0, 0.0, 0.0, -0.0, 30.0, 0.0)
The bug seems to be this line in adstring.jl
:
dec_string = @sprintf("%+03.2d %02d %s", dec_deg, dec_min, dec_sec_string)
which ignores the negative zero.
A possible fix (although, since I'm a beginner, probably not a reliable one) could be:
dec_string = (dec > 0 ? "+" : "-") * @sprintf("%02.2d %02d %s", abs(dec_deg), dec_min, dec_sec_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment