diff --git a/lib/microwaveprop_web/live/path_live.ex b/lib/microwaveprop_web/live/path_live.ex index 4f5a8e76..99cdfb4d 100644 --- a/lib/microwaveprop_web/live/path_live.ex +++ b/lib/microwaveprop_web/live/path_live.ex @@ -464,6 +464,9 @@ defmodule MicrowavepropWeb.PathLive do defp format_number(n) when is_float(n), do: :erlang.float_to_binary(n, decimals: 1) defp format_number(n), do: to_string(n) + defp format_small(n) when is_float(n), do: :erlang.float_to_binary(n, decimals: 4) + defp format_small(n), do: to_string(n) + defp format_km_mi(km), do: Microwaveprop.Format.distance_km(km) defp format_utc_hour(%DateTime{} = dt), do: Calendar.strftime(dt, "%H:%M") @@ -727,16 +730,13 @@ defmodule MicrowavepropWeb.PathLive do
- Gas rate: {format_number( - Float.round( - (@result.loss_budget.o2 + @result.loss_budget.h2o) / max(@result.dist_km, 0.001), - 4 - ) + Gas rate: {format_small( + (@result.loss_budget.o2 + @result.loss_budget.h2o) / max(@result.dist_km, 0.001) )} dB/km
- H₂O: {format_number(@result.band_config.h2o_coeff)} dB/km/g · - O₂: {format_number(@result.band_config.o2_db_km)} dB/km + H₂O: {format_small(@result.band_config.h2o_coeff)} dB/km/g · + O₂: {format_small(@result.band_config.o2_db_km)} dB/km
<%= if @result.conditions do %>
Abs humidity avg: {format_number(@result.conditions.abs_humidity)} g/m³