lib/yaml-cv.rb in yaml-cv-0.1.9 vs lib/yaml-cv.rb in yaml-cv-0.1.10
- old
+ new
@@ -66,18 +66,19 @@
def skills
# split into an n-column table
nskills = @cv["skills"]["fields"].length()
ncols = @cv["skills"]["columns"]
- nrows = (nskills / ncols).ceil
+ nrows = (nskills.to_f / ncols).ceil
skills_table = Array.new(nrows){Array.new(ncols)}
i = 0
while i < nskills
col = i % ncols
- row = i / nrows
+ row = i / ncols
+
skills_table[row][col] = @cv["skills"]["fields"][i]
i = i + 1
end
skills_table
\ No newline at end of file