Skip to content

Commit a945351

Browse files
committed
Floats 😒
1 parent 6b29822 commit a945351

File tree

5 files changed

+1981
-886
lines changed

5 files changed

+1981
-886
lines changed

‎app/models/shot_information/profile.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ def csv_profile
6060
csv << ["meta", nil, nil, nil, nil, nil, nil, nil, nil, "Export version", "1.0.0", nil]
6161

6262
timeframe.each.with_index do |time, i|
63-
csv << ["moment", time, data.dig("espresso_pressure", i), data.dig("espresso_weight", i), data.dig("espresso_flow", i), data.dig("espresso_flow_weight", i), nil, data.dig("espresso_temperature_mix", i), data.dig("espresso_temperature_basket", i), nil, nil, "Visualizer"]
63+
csv << ["moment", time.to_f.round(5), data_point("espresso_pressure", i), data_point("espresso_weight", i), data_point("espresso_flow", i), data_point("espresso_flow_weight", i), nil, data_point("espresso_temperature_mix", i), data_point("espresso_temperature_basket", i), nil, nil, "Visualizer"]
6464
end
6565
end
6666
end
67+
68+
def data_point(key, index)
69+
data[key][index].to_f.round(5) if data[key]
70+
end
6771
end

0 commit comments

Comments
 (0)