Garry's Mod Wiki

File:ReadFloat

  number File:ReadFloat()

Description

Reads an IEEE 754 little-endian 4-byte float from the file.

Returns

1 number
The read value

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()