Crystal report issue with int to string conversion

Zeb-ur-Rehman picture Zeb-ur-Rehman · Jan 5, 2013 · Viewed 32.9k times · Source

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.

Answer

Coder picture Coder · May 23, 2013

ToText(x, y, z, w) Function can use

x=The number to convert to text

y=The number of decimal places to include in result (optional). The value will be rounded to that decimal place.

z=The character to use as the thousands separator. If you don’t specify one, it will use your application default. (Optional.)

w=The character to use as the decimal separator. If you don’t specify one, it will use your application default. (Optional.)

Examples

ToText(12345.678) = > “12345.678″

ToText(12345.678,2) = > “12345.67″

ToText(12345.678,0) = > “12345″