[erlang-questions] Reading a float from standard input

Guilherme Andrade <>
Sun May 29 18:17:20 CEST 2016


On 29 May 2016 at 16:00, Donald Steven <> wrote:

> The following works: {X, _} = string:to_float(string:strip(io:get_line("X:
> "), right, $\n)),
>
> but is there a less cumbersome way to read a float from the standard input?
>

{ok, [F]} = io:fread("give me your floats: ", "~f")

Cheers,




>
> Thanks.
>
> Don
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Guilherme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160529/bd01bb7b/attachment.html>


More information about the erlang-questions mailing list