Format negativ number
Hello,
last week I installed Fastreport 2025.1.5.
Reports I created with Version 2022.3 and open it with the new version shows negative numbers -1.234,67.
If I create a new report the negative numbers is shown as 1.234,67-
Both are formatted with %2.2n
I want the minus in front of the number.
Can anybody help me?
Thank you
Comments
G'day Brigitte,
First a question: are you running this on a machine with Microsoft Windows?
If so, have you checked the computer's Control Panel Settings (under Region / Formats / Additional Settings)?
We've had "inconsistent" results occaisonally on Computers (usually new ones added to the Network) that aren't set up to "local standard" which is to show negative amounts in brackets (see attached screenshot).
Hope this helps...
Cheers, Paul
Hello Paul,
you can see my configuration below.
Both reports use the format %2.2n and both are previewed with fastreport version 2025.1.5 on the same machine.
The report showing negativ numbers as -102,23 was created with version 2022.3 and the report showing 102,23- was created with version 2025.1.5
G'day Brigitte,
Thanks for the information. Unfortunately this just raises a whole lot of other questions 😁
For example: are the values shown on your report generated directly by the designed report, or are they the result of FastScript, or Delphi code?
Basically at which point is your design referencing "%2.2n"? Is it the FormatStr Property in DisplayFormat, or somewhere else?
Our simplest reports just use the "native" FastReports methods (e.g. the above) but more complex reports calculate and format the values in (say) the BeforePrint Event in Delphi code.
Would it be possible to include a simple example of the Report / Code here for the User Group to consider?
Cheers, Paul
Hi Paul,
the data I get from a ADO Query to mssql.
I have attached a very simple report. It was created with fastreport 2022 with the field N2. Minus is shown behind the number. Then I open the report with fastreport 2025. The minus is still behind the number. Then I add a new field N3 and make a preview. For N2 the minus is behind the number and for the new field in front of the number. Crazy
select -1111.11 N2 with Version 2022
and addes ',-2222.22 N3' with version 2025
Brigitte
How can I attach the report?
G'day Brigitte,
Curious!
Can you export the Report design as an FR3 file? We should all be able to read that...
Cheers, Paul
Hi Paul,
fr3 I could not upload. But the zipped. 😉
Can you open it with the same result?
Brigitte
Hi Paul,
I find the problem.
while compiling the program for a Report designer the property TfrxDesigner.RTLLanguage accidentally was set to true.
Thank you very much for your help.
Brigitte
G'day Brigitte,
I am glad it is fixed! And it is so much more satifying to solve it yourself! 😉
Tschüss Paul