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

Prevent from adding ".00" to text field containing numbers 2

Status
Not open for further replies.

hallux

Programmer
Feb 25, 2003
133
US
Hi all,
The following formula creates a room and schedule number for a list of clients as such: 4.3, 1.2, where 4 and 1 are room numbers and 3 & 2 are client numbers. On my development workstation they display as expected, but on other workstations is appends ".00" to the end so the display is "4.3.00" and "1.2.00". It appears that Crystal is interpreting this formula as a number and adding two place decimals. I tried to have another formula reference this one and again use the "totext" function to prove to Crystal that it is not to be treated as a number.
Any ideas?

[red] totext(right({rm.ROOM}, len({rm.ROOM})-instrrev({rm.ROOM}, " ")) + "." + totext(RmCounter)); [/red]
 
Try:

totext(right({rm.ROOM}, len({rm.ROOM})-instrrev({rm.ROOM}, " "),0,"") + "." + totext(RmCounter),0,"")

The second parm of totext is the decimal places, the third being the thousands separator.

-k
 
You can also try this...

Name : {@RoomPeriodClient}
Formula : Replace (ToText ({rm.ROOM}) + "." + ToText ({rm.COUNTER}),".00" ,"" )
 
Thanks for the suggestions:
Adding the [blue],0[/blue] after RmCounter worked!

[red]totext(right({rm.ROOM}, len({rm.ROOM})-instrrev({rm.ROOM}, " ")) + "." + totext(RmCounter[/red][blue],0[/blue][red])); [/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top