fn: lua_pushnumber
[contents]

Contents

Syntax

The syntax for lua_pushnumber calls is:

f++:  
lua_pushnumber(number)

n++:  
@lua_pushnumber(number)

Description

The lua_pushnumber function takes a single number parameter and pushes the number on to the Lua stack, it is a binding for this function.

f++ example

Example of lua_pushnumber being used with f++:

  1. lua_pushnumber(14.8)
  2. lua_setglobal("x")
  3. lua
  4. {
  5. print("x: ", x)
  6. }

n++ example

Example of lua_pushstring being used with n++:

  1. @lua_pushnumber(14.8)
  2. @lua_setglobal("x")
  3. @lua
  4. {
  5. print("x: ", x)
  6. }