system.playNumber¶
since 1.1.0
Play a number using the current locale.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
value |
number | yes | |
unit |
number | optional (default is 0) |
|
decimals |
number | optional (default is 0) |
|
voice |
number | optional (default is 0) |
|
priority |
number | optional (default is 0) |
Returns¶
Nothing.
Examples¶
system.playNumber(11.8, UNIT_VOLT, 1) -- "eleven point eight volts"
system.playNumber(75, UNIT_PERCENT, 0) -- "seventy five percent"
-- speak a source with its own unit and precision
local src = system.getSource({ category = CATEGORY_SYSTEM, member = MAIN_VOLTAGE })
if src then system.playNumber(src:value(), src:unit(), src:decimals()) end
Used in¶
Real-world usage¶
Called 6 times across 4 open-source Ethos Lua projects. A few short excerpts: