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

rounding in formula field 1

Status
Not open for further replies.

mmarino

Programmer
Mar 22, 2002
42
US
Hi everyone, I have a problem trying to put integers in a formula field. Basically I want to say "(# Lines") where # is my number. My formula looks like this:

if tonumber({tbTradeLineHistory.NumberOfLines}) = 1 then "(1 Line)"
else "(" & round({tbTradeLineHistory.NumberOfLines}) & " Lines)"[/color red]

what happens is that I get "2.00 Lines" instead of "2 Lines". If I have only the number without the word "lines" it works great, but as soon as I add the rest, it breaks. I've tried round, truncate, fix, and nothing seems to work. What am I doing wrong?
Thanks in advance,

Monica
 
Hi Monica,
I use the code below:
Code:
// Whole numbers (so no decimals) and no thousand separators
ToText({MyTable.MyField},0,"")

Hope this helps.
ShortyA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top