Page 1 of 1

FloatToString$ issue

Posted: Tue Mar 20, 2012 5:46 pm
by jadiflow
Hi all,

I have a problem with the FloatToString$ function.
It seems to work OK until the argument to FloatToString$ is larger than 32k.
Above a value of 32k, incorrect values are printed.
Is there a limit to the FloatToString$ function preventing it to convert values above 32k?

jan

Re: FloatToString$ issue

Posted: Tue Mar 20, 2012 6:23 pm
by Benj
Hi Jan,

Which version of Flowcode are you using?

V4 and V5 use a 16-bit signed variable for the whole portion of the number which only allows 0 to 32657

In v4 you can edit this by opening the internals.h file in the FCD folder and editing this line in the FCI_FLOAT_TO_STRING function code.

Code: Select all

	int whole;
to this to get 0 - 65535

Code: Select all

	unsigned int whole;
or you could use the following in v5 to get an even larger range.

Code: Select all

	long whole;
In v5 the file to edit is the PIC_CAL_STRING.c file in the "CAL/PIC" folder.