FANDOM


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

DefinitionEdit

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 Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.