NumberValue
A container object for a single double-precision floating point number.
| Memory category | Instances |
|---|
Member index 3
Description
A NumberValue is an object whose purpose is to store a single
Luau number, defined to be
double-precision floating point number,
or more commonly known as a double. This stores a number in 64 bits (8
bytes) using the IEEE 754 representation (1 sign bit, 11 exponent bits and 52
fractional bits). Maximum and minimum values are
±1.7976931348623157e+308, with a range of ±2^53 for exact
integer representations.
Like all Value objects, this object stores a single value in the Value
property. The Changed event fires with the new value being stored in the
object, instead of a string representing the property being changed.
History 11
- 553 Change PreferredDescriptor of changed from to Changed
- 553 Change Default of Value from to 0
- 486 Change ThreadSafety of Value from ReadOnly to ReadSafe
- 462 Change ThreadSafety of changed from to Unsafe
- 462 Change ThreadSafety of Changed from to Unsafe
- 462 Change ThreadSafety of Value from to ReadOnly
- 335 Change Superclass of NumberValue from Instance to ValueBase
- 50 Add changed
- 47 Add Changed
- 47 Add Value
- 47 Add NumberValue
Members 3
Changed
| Parameters (1) | |
|---|---|
| value | double |
This event fires whenever the NumberValue.Value property changes.
This event, like other changed events, can be used to track when an
NumberValue changes and to track the different values that it may change
to.
For instance, this event can be useful in games that rely on
NumberValues to track game states and values, such as item IDs.
Equivalent changed events exist for similar objects, such as ObjectValue and StringValue, depending on what object type best suits the need.
| Thread safety | Unsafe |
|---|
Value
| Type | Default | |
|---|---|---|
| double | 0 | |
Used to hold a double value.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
changed
| Parameters (1) | |
|---|---|
| value | double |
| Thread safety | Unsafe |
|---|