Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula Extracting Numeric from String, with £ 1

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
0
0
IE
Hello

I have a formula:
@extract
if isnumeric ({FreightJobs.SpecialCharacter06})
then tonumber({FreightJobs.SpecialCharacter06})
else 0;
and when it has to extract from £10,000, the 10,000, it gives me 0, so it says that are not numeric in £10,000. The formula works fine for €500, $30,000, ...

What do I do wrong, please?
 
Try:

Stringvar x := {FreightJobs.SpecialCharacter06};
If not isnumeric(x[1]) then
Tonumber(Mid(x,2)) else
Tonumber(X)

-LB
 
Thank you, LB.
It works for £10,000, but stops at some record saying: the string is not numeric and highlights Tonumber(Mid(x,2)).
Could you explain the formula, please?
 
Try this:

stringvar x := {FreightJobs.SpecialCharacter06};
if trim(x) = "" then
0 else
if not isnumeric(x[1]) then
tonumber(mid(x,2)) else
tonumber(x)

You can then format the field->customize->suppress if zero.

If this still doesn't work, please provide a sample that includes all variations that can occur in the field.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top