View Source TelemetryUI.Web.Component.Value.PrettyFloat (telemetry_ui v0.0.1)

Pretty prints a float into either a float or an integer. If the float ends with .0, it returns an integer.

This is used to have a pretty percentage output.

examples

Examples

iex> PrettyFloat.convert(2.0) 2 iex> PrettyFloat.convert(2.2) 2.2 iex> PrettyFloat.convert(28) 28

Link to this section Summary

Link to this section Functions