在小数点后隐藏零-在快速报表.net中 [英] hide zero next the decimal number -- in fast Report .net

查看:73
本文介绍了在小数点后隐藏零-在快速报表.net中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友.

table1有一个字段:Numeric(18,2)

但在fastreport中:在小数点图标旁边显示零
例如:
2>> 2.00
3.5>> 3.50

我想隐藏零
什么是解决方案?
例如:
2>> 2.
3.5>> 3.5

在字段的属性中选择:隐藏零= true
但是没有效果
什么是解决方案?
:)

hi friends.

table1 have a field : Numeric(18,2)

but in fastreport: show zero next the decimal icon
for example:
2 >> 2.00
3.5 >> 3.50

i want to hide zero
what is solution??
for example:
2 >> 2.
3.5 >> 3.5

in properties of field is select : hide zero = true
But had no effect
what is solution?
:)

推荐答案

让我们说您有一个像这样的表:


Lets say you have a table like this:


CREATE TABLE [dbo].[Table_1]
(
    [test] [numeric](18, 2) NULL
) ON [PRIMARY]  



下面的查询应为您提供所需的结果:



The query below should give you results like you want:

SELECT
    Test,
    CASE WHEN (Test % 1) > 0 THEN CAST(Test AS FLOAT) ELSE (CAST(Test AS INT)) END AS Output
FROM Table_1


即使您可以部分格式化SQL语句中的数据,我还是建议对其进行格式化那个报告.

您是否尝试使用%g作为格式.从内联格式 [
Even though you can partially format the data in the SQL statement I would advice to format it on the report.

Have you tried using %g as the format. Picked up this from Inline formatting[^]


这篇关于在小数点后隐藏零-在快速报表.net中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆