Hi all,
I'm trying to extract the strength of a drug from a string.
The string {xdailyissues.drug_strength} can be any one of the following formats:
125 mg
2 g
1.2 mega unit
200 mg in 5 ml
100mg in 5ml
I want the formula to output the result in milligrams. For those of you who dont know 1000mg = 1 gram.
I only need the number.
Therefore in the examples above:
125 mg would output= 125
2 g would output= 2000
200 mg in 5ml would output= 200
1.2 mega unit would output= 1200 (a mega unit is a gram !)
100mg in 5ml would output= 100
The numbers could be different they are all not what is described above for example it might be:
375mg in 5ml or
2.2g
Hope all that makes sense....
I'm really stuck with this one...
Any help would be gratfefully recieved... !
Steve
Authorised re-seller of CRD (a powerful scheduling tool for automating Crystal reports)
Visit for 10% discount.
I'm trying to extract the strength of a drug from a string.
The string {xdailyissues.drug_strength} can be any one of the following formats:
125 mg
2 g
1.2 mega unit
200 mg in 5 ml
100mg in 5ml
I want the formula to output the result in milligrams. For those of you who dont know 1000mg = 1 gram.
I only need the number.
Therefore in the examples above:
125 mg would output= 125
2 g would output= 2000
200 mg in 5ml would output= 200
1.2 mega unit would output= 1200 (a mega unit is a gram !)
100mg in 5ml would output= 100
The numbers could be different they are all not what is described above for example it might be:
375mg in 5ml or
2.2g
Hope all that makes sense....
I'm really stuck with this one...
Any help would be gratfefully recieved... !
Steve
Authorised re-seller of CRD (a powerful scheduling tool for automating Crystal reports)
Visit for 10% discount.