mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
HTML: Fix Null values in yearly statistics export.
Null values should be handeled nicely instead of showing NULL or Nan. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d2990aea6f
commit
9470be0a77
1 changed files with 6 additions and 3 deletions
|
@ -201,9 +201,12 @@ void DiveLogExportDialog::exportHTMLstatistics(const QString &filename)
|
||||||
out << "\"AVG_SAC\":\"" << get_volume_string(stats_yearly[i].avg_sac) << "\",";
|
out << "\"AVG_SAC\":\"" << get_volume_string(stats_yearly[i].avg_sac) << "\",";
|
||||||
out << "\"MIN_SAC\":\"" << get_volume_string(stats_yearly[i].min_sac) << "\",";
|
out << "\"MIN_SAC\":\"" << get_volume_string(stats_yearly[i].min_sac) << "\",";
|
||||||
out << "\"MAX_SAC\":\"" << get_volume_string(stats_yearly[i].max_sac) << "\",";
|
out << "\"MAX_SAC\":\"" << get_volume_string(stats_yearly[i].max_sac) << "\",";
|
||||||
|
if ( stats_yearly[i].combined_count )
|
||||||
out << "\"AVG_TEMP\":\"" << QString::number(stats_yearly[i].combined_temp / stats_yearly[i].combined_count, 'f', 1) << "\",";
|
out << "\"AVG_TEMP\":\"" << QString::number(stats_yearly[i].combined_temp / stats_yearly[i].combined_count, 'f', 1) << "\",";
|
||||||
out << "\"MIN_TEMP\":\"" << get_temp_units(stats_yearly[i].min_temp, NULL) << "\",";
|
else
|
||||||
out << "\"MAX_TEMP\":\"" << get_temp_units(stats_yearly[i].max_temp, NULL) << "\",";
|
out << "\"AVG_TEMP\":\"0.0\",";
|
||||||
|
out << "\"MIN_TEMP\":\"" << ( stats_yearly[i].min_temp == 0 ? 0 : get_temp_units(stats_yearly[i].min_temp, NULL)) << "\",";
|
||||||
|
out << "\"MAX_TEMP\":\"" << ( stats_yearly[i].max_temp == 0 ? 0 : get_temp_units(stats_yearly[i].max_temp, NULL)) << "\",";
|
||||||
out << "},";
|
out << "},";
|
||||||
total_stats.selection_size += stats_yearly[i].selection_size;
|
total_stats.selection_size += stats_yearly[i].selection_size;
|
||||||
total_stats.total_time.seconds += stats_yearly[i].total_time.seconds;
|
total_stats.total_time.seconds += stats_yearly[i].total_time.seconds;
|
||||||
|
|
Loading…
Reference in a new issue