These docs are for v2.0. Click to read the latest docs for v3.0.

Read a serialized amount into an XFL

Concepts

Behaviour

  • Read a serialized floating point number.
  • If there are more fields/data after the serialized floating pointer number then ignore them.
  • Return it as an XFL enclosing number

Definition

int64_t float_sto_set (
    uint32_t read_ptr,
    uint32_t read_len
);

Example

int64_t vault_pusd = float_sto_set(vault, 8);
if (vault_pusd < 0)
  rollback("Failed to parse serialized float.", 33, 1);

Parameters

NameTypeDescription
read_ptruint32_tPointer to a buffer contianing the serialized XFL. May be null.
read_lenuint32_tThe length of the buffer.

Return Code

TypeDescription
int64_tThe number of bytes written to the output buffer.

If negative, an error:
NOT_AN_OBJECT
- the supplied buffer did not contain a valid serialized floating point number

OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.