English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang float method

Numbers in Erlang

This method converts a number to a floating-point value.

Syntax

float(X)

Parameter

X-A numeric value.

Return Value

The return value is a floating-point number.


-module(helloworld). 
-export([start/). 
start() ->
   Num = float(3), 
   io:fwrite("~f",[Num]).
When we run the above program, we will get the following results.
3.000000

Numbers in Erlang