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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting String to Numeric

Status
Not open for further replies.

davidmo

Technical User
Apr 8, 2003
97
US
I am trying to convert a string to numeric format so i can summerize the amount. any help would be great.
 
Try:

val({table.field}) in a formula, and then do your summary against the formula.

-k

 
I created the formula val({initial.amount}) and when i refreshed the data it made all the amounts equal to 0. Not sure what I did wrong. What do I need to add or clarify?
 
this means that you have a non-numeric character as the first chracter of your string

Val reports numbers until it reaches a non-numeric character

eg.

Val("223abc") = 223.00
Val("abc223") = 0.00

now we get into numeric signs and they seem to cause a problem with Val

Val("+123") = 0.00

(this is weird but happens on my machine with CR 7)
Val("-123") = -23.00

I prefer toNumber actually

ToNumber("+123") = ***error*** non-numeric
toNumber("-123") = -123.00

there is still a problem with having a + sign but at least the negatives calc correctly...also you don't get a FALSE zero value as you would with VAL...you can always test with NumericText and strip off a "+" if this is the problem.

Jim Broadbent
 
Thanks. I had $ at the front of the string so by eliminating that the formula worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top