Products A-Z All Services Can't find what you're looking for? Chat Live!
Products A-Z Can't find what you're looking for? Chat Live!
Can't find what you're looking for? Chat Live!
I need to insert a summary field on the Currency_Amount field (exported from RE with Export). Thing is that RE exports this field fully formatted, therefore it is a string field.
Crystal cannot summarize on a string field, so I would need to convert it to a number (ex: ToNumber() ), however, because of the various countries and number formatting, crystal does not reccognize most strings as being numeric. Example, ToNumber will not work for "$ 1,000,000.00". To complicate things more, my report will include many different types of currencies (Euros, Yens, Pounds...). This means that I cannot just easilly use the replace function first.
Any ideas?
Thanks,
William
Try CCur() instead. It will automatically remove the "$" from your string. I don't know what it does with euros, yens, pounds, etc.
Drew
For now, I am sumarizing on this function.... (basic syntax)
Dim Result as StringResult = {Gf.Gf_Currency_Amount}IF InStr (1, Result, ".") > 1 THEN Result = Replace(Result,",","")END IF
Formula = ToNumber(Replace(Replace(Replace(Replace(Replace(Result,"$",""),"£",""),"¥",""),"€","")," ",""))
I can see why you might want to summarize for each currency, but I don't see why you would want to sum a mix of currencies together.
Hi Drew,
You are correct. I am not adding different currencies together. I do however want to sum up amounts for each currency seperately, but they all appear on the same report.
Example, my report could look like
CAD = 10 000
USD = 10 000
EUR = 10 000
...
Each 10 000 of what ever can be comprised of many different gifts. RE exports the amounts with the proper currency symbols and "punctuation". Crystal is unable to recognize these as numbers and can not sum on it.
Ccur did not work.
Changed my function to Crystal Syntax. I thought it was giving me an error when running through RE.
I also added a replace to deal with "," as a decimal separator.
StringVar Result := {Gf.Gf_Currency_Amount};
IF InStr (1, Result, ".") > 1 THEN (
Result := Replace(Result,",","") )ELSE ( Result := Replace(Result,",",".") );
ToNumber(Replace(Replace(Replace(Replace(Replace(Result,"$",""),"£",""),"¥",""),"€","")," ",""))