当数据是多种格式的混合时,如何使用 2 位数字处理来格式化 SSRS 字段

How to format a SSRS field with 2-digits of procession when the data is a mix of formats

我有来自存储过程的数据,看起来像这样,需要以两位数的精度显示在我的报告中。数据全部为 NVARCHAR,但混合了看起来是数字或显示为 'Max'.

的行

如何只显示2位精度?我尝试了以下方法,它对数字外观数据很有效,但在 'Max'.

上出错
=FormatNumber(Fields!TBS.Value, 2)

使用 IIF 确定该值是否为数字,然后使用 IIF 确定其格式。

=IIF(ISNUMERIC(Fields!TBS.Value), FormatNumber(Fields!TBS.Value, 2), Fields!TBS.Value)

IsNumeric:

Returns a Boolean value indicating whether an expression can be evaluated as a number.

MS SSRS 说明