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 Text to Number

Status
Not open for further replies.

wanzek1

Technical User
Jun 13, 2012
79
US
I have tried the following:

Val(field)
ToNumber(field)
If NumericText ({field}) then ToNumber ({field}) else 0

None of them work. The information in the field that I need to convert ToNumber for sorting purposes is:
1
1.01
10
11
17.01
17.02
50.01

When I use any of the formulas above it will not include anything after the period since it is currently text. Is there away around this to get crystal to see that as a decimal?
 
This is essentially the same as your last formula, but is how i would do it:

IF isnumeric({users.PersonID})=TRUE then tonumber({users.PersonID}) else 0

I think your formula should return a number equal to the text field's value (ie: decimals included)
Check your document default number formatting to make sure it displays numbers to the right of the decimal.
Also check the value for the item displayed in the report. Right click on it, select the 'format field' option and then on the 'Number' tab you can set the number formatting you desire.
 
Thank you for your help. It was how it was being displayed. The number was being rounded.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top