Capy-Bearer Documentation

s16

lib call

Capy

function s16(value : as string, opt : dval = {}) s16

s16() parses text in the range -32768 through 32767. Invalid or out-of-range text returns opt.fallback. The default fallback is 0.

Parameters

value : scalar value or text to convert

opt : options map with fallback and base

Return Values

A signed 16-bit integer, or opt.fallback.

Example

Capy

print(s16("8000", {base: 16, fallback: -1}), "\n")