Skip to content

Commit a2241f9

Browse files
committed
Update sample_set.rb
1 parent b98f485 commit a2241f9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/models/genome/sample_set.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ def parse_location_coordinate(string, type)
221221
# 1. Degrees
222222
# 2. Minutes
223223
# 3. Seconds
224-
sg_coord = /(#{num}) *°(?: *(#{num}) *['′](?: *(#{num}) *(?:"|″|''|′′))?)?/
224+
sg_coord =
225+
/(#{num}) *°(?: *(#{num}) *['′](?: *(#{num}) *(?:"|″|''|′′))?)?/
225226
# A generic coordinate (complete), captures:
226227
# 1. Sign (plus, minus, or nil)
227228
# 2. The numeric part of the coordinate (decimal or sexagesimal)
@@ -263,7 +264,8 @@ def location_coordinate_to_string(float, type)
263264
min = (base * 60).floor
264265
y += ' %i′' % min
265266
base -= min.to_f / 60
266-
y += ' %.2g″' % (base * 60 * 60).round(2) unless base.zero?
267+
sec = (base * 60 * 60).round(2)
268+
y += ' %.2g″' % sec unless sec.zero?
267269
end
268270
y + ' ' + dir
269271
end

0 commit comments

Comments
 (0)