<p>Am 24.08.2017 14:00 schrieb "James Richters" <<a href="mailto:james@productionautomation.net">james@productionautomation.net</a>>:<br>
><br>
> Thanks everyone for the explanation and solutions. I can work around it well enough now that I understand what’s happening, but I’m still curious if there is a way to define fixed point variables? In a C++ Project I was helping with recently, they had a way of defining a variable as having 2 places before the decimal and 30 places after? Since the decimal could never move (float) It ended up being much better defined. It’s like always moving the decimal over 30 places to the right, using integer math, then moving it back. I’m not sure if this was something the compiler did, or if maybe they had their own functions to do this… I had a difficult time following how things worked, but I do remember the fixed point variables. Anyway I thought I would just ask the question in case there is a way to define this in FreePascal<br>
></p>
<p>They probably had a custom type with operator overloads and such for that which can be parameterized as a template with the amount of digits before and after the comma...</p>
<p>Somethings like that can be implemented in FPC as well, but the implementation would need to be done first at all ;)</p>
<p>Note: FPC (and Delphi) has a single fixed point type which is Currency. AFAIK it uses four digits after the comma and 28 in front of it.</p>
<p>Regards,<br>
Sven</p>