开发者

How to format NUMBERS in report?

开发者 https://www.devze.com 2023-03-20 02:08 出处:网络
I have a calculated double Price field in my report that sometimes have a value such as 1.23456. Each row in my report has these data: Product name followed by Price in parentheses.

I have a calculated double Price field in my report that sometimes have a value such as 1.23456.

Each row in my report has these data: Product name followed by Price in parentheses.

=[ProductName] & ' (' & [Price] & ') '

How do I format the Price in the above expression IN THE REPORT DESIGN so that Price always has this format: 1.23? Meaning always having 2 digits after the decimal point.

开发者_Go百科

Thanks. Please note I want to do this at the REPORT DESIGN, not table creation or calculation.


If you go to the Report Design view and right-click on the field that you want to format, open the properties menu.

Under the Format tab on the Properties window, there are 2 options

Format
Decimal Places

You could select Currency or General Number in the Format option and put 2 in the Decimal Places option.

Based on your edit you might be able to do the following, I haven't had a chance to test this.

=[ProductName] & ' (' & FormatNumber([Price], 2) & ') '
0

精彩评论

暂无评论...
验证码 换一张
取 消