在FastReport/Delphi中更改货币格式

1 delphi formatting fastreport

在FastReport中,我想更改包含货币值的字段的格式.

现在它使用格式%2.2n,显示数字为1,234.50.我想将其更改为1.234,50,但似乎无法在Delphi文档中找到可以为我执行此操作的格式.是否存在具有此目的的格式或者是否必须使用构建全新字段FormatFloat?

bum*_*mmi 8

您不限于可以使用FormatStr的默认值,例如使用$ ###0.00和更改DecimalSeparator和ThousandSeparator.

在此输入图像描述 在此输入图像描述


Pet*_*ter 5

FastReport关于数字格式的文档如下:

\n\n
for numerical formatting:\n%g \xe2\x80\x93 number with the minimal places after the decimal point\n%2.2f \xe2\x80\x93 number with a fixed number of places after the decimal point\n%2.2n \xe2\x80\x93 as previous, but with thousands separator\n%2.2m \xe2\x80\x93 monetary format, accepted by the Windows OS, dependent on the regional settings in the control panel\n
Run Code Online (Sandbox Code Playgroud)\n\n

如果报告是由客户端生成的,那么最好将其设置为2.2m,但如果您自己生成报告并将其提交给客户,那么您将不得不寻求替代方案。

\n