Skip to content

Commit

Permalink
Changing in Formatting Output (#334)
Browse files Browse the repository at this point in the history
Changes the output format when converting from decimal to colon format. Should allow for more conventional formatting.
  • Loading branch information
kjkoeller authored Sep 29, 2023
1 parent c6580b4 commit 1400a0c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions EclipsingBinaries/vseq_updated.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ def conversion(a):
num2 = abs((num1 - int(num1)) * 60)
num3 = format((num2 - int(num2)) * 60, ".3f")
num4 = float(num3)
b.append(str(int(num1)) + ":" + str(int(num2)) + ":" + str(abs(num4)))
formatted_time = f"{int(num1):02d}:{int(num2):02d}:{abs(num4):06.3f}"
b.append(formatted_time)
else:
num2 = (num1 - int(num1)) * 60
num3 = format((num2 - int(num2)) * 60, ".3f")
b.append(str(int(num1)) + ":" + str(int(num2)) + ":" + str(num3))
formatted_time = f"{int(num1):02d}:{int(num2):02d}:{float(num3):06.3f}"
b.append(formatted_time)

return b

Expand All @@ -75,6 +77,7 @@ def splitter(a):
# makes the coordinate string into a decimal number from the text file
step = []
final = []

for i in a:
new = i.split(":")
num1 = int(new[0])
Expand Down

0 comments on commit 1400a0c

Please sign in to comment.