Welcome, Guest
Username: Password: Remember me
Components and Libraries for Documents Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Number in cell and formatting 8 years 10 months ago #8955

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
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.

Number in cell and formatting 8 years 10 months ago #8956

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4537
  • Thank you received: 1115
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

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

Last edit: by Sternas Stefanos.

Number in cell and formatting 8 years 10 months ago #8957

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
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.

Number in cell and formatting 8 years 10 months ago #8958

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
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.

Number in cell and formatting 8 years 10 months ago #8959

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4537
  • Thank you received: 1115
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.

Number in cell and formatting 8 years 10 months ago #8972

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
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.

Number in cell and formatting 8 years 10 months ago #8973

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
I attach a picture to explain the problem.
Attachments:

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

Number in cell and formatting 8 years 10 months ago #8974

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4537
  • Thank you received: 1115
Sir
I think all are OK
or
I can't see the problem
PilotLogic Architect and Core Programmer

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

Number in cell and formatting 8 years 10 months ago #8975

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
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.

Number in cell and formatting 8 years 10 months ago #8976

  • wilhelm
  • wilhelm's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
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.

Number in cell and formatting 8 years 10 months ago #8981

  • carmelo peri
  • carmelo peri's Avatar Topic Author
  • Visitor
  • Visitor
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.

Number in cell and formatting 8 years 10 months ago #8983

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4537
  • Thank you received: 1115
We put your fix to Lab CT Sir
PilotLogic Architect and Core Programmer

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

Number in cell and formatting 8 years 10 months ago #9001

  • Avra
  • Avra's Avatar
  • Visitor
  • Visitor
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.

  • Page:
  • 1