Skip to main content

float.tochar()

Converts a float to a single-character string

Availability

Device + Agent

Returns

String — the character represented by the truncated float as Ascii value

Description

This method returns the target floating-point value as a single-character string. Though the floating-point value should lie between -127 and 128, Squirrel will accept floats out of this range but will derive the character value from the lowest eight bits of the passed value and ignore the rest.

Because a character value is an integer, there is an implicit integer conversion associated with this method. The value is truncated, not rounded.

Example Code