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

Simple conversion (I thought) 1

Status
Not open for further replies.

Newbi1

Programmer
Apr 4, 2005
64
US
CR 9 --SQL Server -- Win XP

I have a numeric field which I was trying to concatenate with a string field for formating purposes.

an intial value would have been 200000

Code:
{tfacr200.tdoc} + "  " +  Replace (cstr({@docn}),"," ,"" )

When I do a Cstr({value}) I now get the headache of 200,000.00. I can do a replace to get rid of the commas, but how do I get rid of the decimal and added 0s?

I thought it was a simple formula, but with the added junk, not sure if I am doing it right.
 
If you're certain you don't need the decimals, you can use the ToText function like this:

{tfacr200.tdoc} + " " + ToText({@docn}, 0, "")

... where 0 represents the # of decimal places, and "" is the Thousands separator.

-dave
 
Check your number format under Regional and Language Options on the Control Panel. It's likely let to 2 decimal places. I've run into this before and it's a pain.

Kerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top