factored out toFloat
added latency type