DNumberWang/SetDecimals

From Garry's Mod
Jump to: navigation, search
 DNumberWang:SetDecimals( )

Contents

DescriptionPanelFunc

Sets the amount of decimal places allowed in the number selector.

Arguments

number num

The amount of decimal places.

Examples

Example

Sets the number selector to 3 decimal places and sets the value to a random number between 0 and 1.

local numinput = vgui.Create("DNumberWang")
numinput:SetPos(5, 5)
numinput:SetSize(90, 20)
numinput:SetDecimals(3)

numinput:SetValue(math.random())

Output:

DNumberWang SetDecimals example1.png
Personal tools
Navigation