水晶报表整数到字符串转换的问题 [英] Crystal report issue with int to string conversion

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

问题描述

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

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.

但它以这种方式显示我

1.00.

这意味着当我尝试将 int 转换为字符串时,它会将其转换为精度为两个十进制零的数字.有人可以告诉我如何以正确的格式显示它.有关信息,我想告诉您 SrNo 正在运行.

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.

推荐答案

哦,我得到了答案,它是如此简单.totext 需要 4 个参数

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
       }

虽然我认为这个例子可能不太好,但我只是想给你一个想法.这是用于日期的 int 转换,它有 2 个参数.要转换的值和日期格式.

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.

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

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