FloatToString$ issue

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times

FloatToString$ issue

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: FloatToString$ issue

Post 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.

Post Reply