cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplying the two field values in crystal reports

shil123
Participant
0 Kudos

In my crystal report I have a requirement that is,for the amount field I need to multiply two values.

ex:

quantity=10000 kg and price =90

I want to get the result as 900000!

that is in amount field i should get 900000.

I tried {com.qty}*{com.price}

it is giving me an error.

please help me out.?

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor

If the data in your qty field shows "10000 kg" then that field is a string, not a number. So, you need to extract the number from the field in order to do the multiplication. The formula for getting the number value might look like this:

StringVar array quantity = Split({com.qty}, ' ');
if IsNumeric(quantity[1]) then
  ToNumber(quantity[1])
else 0

-Dell

Answers (0)