Garry's Mod Wiki

File:WriteFloat

  File:WriteFloat( number float )

Description

Writes an IEEE 754 little-endian 4-byte float to the file.

Arguments

1 number float
The float to be written to the file.

Example

local f = file.Open( "test.txt", "w", "DATA" ) f:WriteFloat( math.pi ) f:WriteFloat( 66.99 ) f:Close() local f = file.Open( "test.txt", "r", "DATA" ) f:Seek( 4 ) print( f:ReadFloat() ) -- Prints 66.98999786377 f:Close()