Call as
Platform.runes.numberField(self, value, missing)
Record the dependency Platform.runes.numberField, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.
What it does
Normalizes one numeric field of a native result. Returns the value when it is a readable finite number (sign and fractions kept); otherwise nil with "restricted-value", the caller-supplied missing reason when the value is nil, or "invalid-api-result".
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
value | any | Field value from the native result. |
missing | string | Reason to return when value is nil, such as rune-start-unavailable. |
Returns
| 1 | number | nil | The finite value, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Reason when the value is nil. |
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
- Not available on that edition (the reason is in the tooltip)
- Only while Blizzard's deprecation fallbacks are on
| Game API | |||||
|---|---|---|---|---|---|
canaccessvalue |
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
How the addon calls it
Platform.runes.GetRuneCooldownObservationrecord.start,record.startReason=numberField(self,tuple[1],'rune-start-unavailable')Platform.runes.GetRuneEvaluationTimereturn numberField(self,value,'rune-time-unavailable')Platform.runes.GetRuneTypeObservationlocal runeType,why=numberField(self,value,'rune-type-unavailable')
Dependencies
finite→Platform.runes.finite
Source
Platform/runes.lua, line 36. Read only in game; Duplicate makes an editable copy.
Platform.runes.numberField(self, value, missing)
if not self:CanReadValue(value) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(value) then return nil,'restricted-value' end
if value==nil then return nil,missing end
if not finite(value) then return nil,'invalid-api-result' end
return value




