Garry's Mod Wiki

DTextEntry:SetNumeric

  DTextEntry:SetNumeric( boolean numericOnly )

Description

Sets whether or not to decline non-numeric characters as input.

Numeric characters are 1234567890.-

Arguments

1 boolean numericOnly
Whether to accept only numeric characters.

Example

local TextEntry = vgui.Create( "DTextEntry" ) TextEntry:SetNumeric(true)
Output: Only allow numeric characters.