Crystal报表问题与诠释字符串转换 [英] Crystal report issue with int to string conversion

查看:189
本文介绍了Crystal报表问题与诠释字符串转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将int转换为字符串,然后连接点。这是公式

  totext({#SrNo})+。 

它工作正常,但不是我想要的。我想显示为

  1。 

但它以这种方式显示我

  1.00。 

这意味着当我尝试将int转换为字符串时,零。有人可以告诉我,如何以正确的格式显示它。对于信息,我想告诉你,SrNo正在运行总。

解决方案

Ohhh我得到的答案是那么简单。
totext需要4个参数

 第一个参数是要转换的值
第二个参数是number的十进制预览。
第三个参数是小数分隔符。 like(1,432.123)这里dot(。)是第三个参数。
Forth参数是千位分隔符。 like(1,432)这里逗号(,)是第四个参数。

示例{
totext(1,432.1234,2)results 1,432.12
totext(1,432.1234,2,'')results 1,4321234
totext 1,432.1234,2,'',':')results 1:432,1234
}


$ b b

虽然我认为这个例子可能不是那么好,但我只是想给你一个想法这是为日期它有2个参数的int转换
要转换的值和日期的格式。 / p>

I want to convert int to string and then concatenate dot with it. Here is the formula

totext({#SrNo})+ "."

It works perfectly but not what i want. I want to show at as

1.

but it shows me in this way

1.00.

it means that when i try to convert int to string it convert it into number with precision of two decimal zeros. Can someone tell me how can i show it in proper format. For information i want to tell you that SrNo is running total.

解决方案

Ohhh I got the answer it was so simple. totext takes 4 parameters

First parameter is value which is going to be converted
Second parameter is number of decimal previsions.
Third parameter is decimal separator. like (1,432.123) here dot(.) is third parameter.
Forth parameter is thousand separator. like (1,432) here comma(,) is forth parameter.

Example{
        totext("1,432.1234",2) results 1,432.12
        totext("1,432.1234",2,' " ') results 1,432"1234
        totext("1,432.1234",2,' " ', ' : ') results 1:432,1234
       }

Although i think this example may be not so good but i just want to give you an idea. This is for int conversion for date it has 2 parameters. value to be converted and format of date.

这篇关于Crystal报表问题与诠释字符串转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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