× Components and Libraries for Documents Development, discussions, problems and suggestions

Question Number in cell and formatting

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8955 by carmelo peri
Number in cell and formatting was created by carmelo peri
Hello,
I have a problem with pl FPSpreadsheet on codetyphon 5.6 - win32.
If I insert a number in a cell, the number is automatically changed.
For example, entering 1.4 this is transformed into 1.399999999999999.
How can i solve?
thank you

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 10 months ago - 4 years 10 months ago #8956 by Sternas Stefanos
Replied by Sternas Stefanos on topic Number in cell and formatting
Sir
my suggestion is to test and LAB CT 5.70 revision 005631 info
has many changes
-Update pl_FPSpreadsheet to Ver 5.7.2 Source 16-01-2016 SVN Rev 4423

PilotLogic Architect and Core Programmer
Last edit: 4 years 10 months ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8957 by carmelo peri
Replied by carmelo peri on topic Number in cell and formatting
thanks for the reply . I'm taking care to download the version 5.7 and will test soon

Please Log in or Create an account to join the conversation.

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8958 by carmelo peri
Replied by carmelo peri on topic Number in cell and formatting
I installed the CT version 5.7 but nothing has changed . Some help ?
Tanks!

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 10 months ago #8959 by Sternas Stefanos
Replied by Sternas Stefanos on topic Number in cell and formatting
Sir, can you make a test project with the problem ?

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8972 by carmelo peri
Replied by carmelo peri on topic Number in cell and formatting
Thank you Sir, for your interest.
The example in directory "codeocean/fpspreadsheet/sample/fpschart" generates the error described above. it is necessary to specify that this error was not present with version CT 5.2.

Please Log in or Create an account to join the conversation.

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8973 by carmelo peri
Replied by carmelo peri on topic Number in cell and formatting
I attach a picture to explain the problem.
Attachments:

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 10 months ago #8974 by Sternas Stefanos
Replied by Sternas Stefanos on topic Number in cell and formatting
Sir
I think all are OK
or
I can't see the problem

PilotLogic Architect and Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8975 by carmelo peri
Replied by carmelo peri on topic Number in cell and formatting
Sir,
You did not find the problem in example or believes that the operation is correct ?
why it changes only the numbers 1.1, 1.4, 1.6, 1.9?
I accidentally make a wrong setting?

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #8976 by wilhelm
Replied by wilhelm on topic Number in cell and formatting
i can confirm behavior of compilation with 32 bit compiler , but not with 64 bit compiler. With 64 bit all results are ok. i use windows 8.1 ct 5.7 rev. 005631

Please Log in or Create an account to join the conversation.

  • carmelo peri
  • Topic Author
  • Visitor
  • Visitor
4 years 10 months ago #8981 by carmelo peri
Replied by carmelo peri on topic Number in cell and formatting
Sir Sternas Stefanos,
I changed the precision in the row
Result := FloatToStrF(AValue, ffGeneral, 16, 16, fs);
//Result := FloatToStrF(AValue, ffGeneral, 20, 20, fs);
into the file fpsNumFormat.pas and everything is back to work.
what do you think about it?

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 10 months ago #8983 by Sternas Stefanos
Replied by Sternas Stefanos on topic Number in cell and formatting
We put your fix to Lab CT Sir

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Avra
  • Visitor
  • Visitor
4 years 10 months ago #9001 by Avra
Replied by Avra on topic Number in cell and formatting
Using double for storing floating point numbers means that some numbers like 1.4 can not be stored, but instead closest number like 1.399999999999999 is stored. Similar is for single, too. This "feature" can be hidden by rounding numbers, like you have already found. This is not FPC related (although some FPC changes shows this more often then before), as can be seen here:
social.msdn.microsoft.com/Forums/en-US/e...ded-double-constants

Please Log in or Create an account to join the conversation.