nwn

The FloatToString() NWScript command converts a float to a string, with the ability to set the width and precision of the resulting string.

Definition

string FloatToString (float fFloat, int nWidth=18,
int nDecimals=9)

float fFloat
The floating point number that will be converted to a string representation.
int nWidth
The number of characters to the left of the decimal point that will be produced. Should be from 0 to 18 (inclusive).
int nDecimals
The number of digits to the right of the decimal point that will be produced. Should be from 0 to 9 (inclusive).

If the width is larger than needed for the number being converted, the extra characters (to the left of the digits) will be filled in with spaces. There will always be at least one digit (possibly just '0') to the left of the decimal point.

See also