Erlang - float



This method returns the float value of a particular number.

Syntax

float(number)

Parameters

  • number − This is the number which needs to be converted to float.

Return Value

The method returns the float value of a particular number.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[float(5)]).

Output

When we run the above program we will get the following result.

5.0
erlang_bifs.htm
Advertisements