wuz up guys, didnt know where to post this topic.
Well here is my problem

how can I change a varchar to number in crystal report
the value has a "-" dash in it and I wanted to convert this to number so I can display the number to arabic.

for example is 1-324 will be converted to a number.
is this possible?
tnx in advance

Hi doods,
Let me help you....

Stringvar S;
Numbervar N;

S := "1-324";

N := ToNumber(replace(s,"-",""));

the result is : 1,324.00.

to conver it to Arabic, eehmmmm :-/

Thanks.

tnx for the reply kusno but the "-" is needed for the report.
and another question is that if there is a zero in front of the number for example 0112233, crystal doesnt shows the zero in front, it only shows the 112233 numbers.
Do you have any ideas about this?

I don't get at with what you want. If you want to convert it to numeric, of course you need to remove character symbol.
But, you want to display it in an report, so you don't need to convert it anymore....

For last case, I didn't see if Crystal Report can display it to 0112233.
I think, you can use Reporting Services instead of Crystal Report because Reporting Services can use VB format.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.