Normal Topic Stripping Trailing Zeros In An XUserSelect (Read 3128 times)
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Stripping Trailing Zeros In An XUserSelect
Mar 26th, 2004 at 3:31pm
Print Post Print Post  
The following code eliminates the problem of numbers having trailing zeros when displayed in XUserSelect.

@XUserSelect("C:\Sesame\Data\Samples\Customers.db", "KEY")

will return -
937.000000
938.000000
939.000000
940.000000
....

The following code will return
937
938
939
940

It also retains decimals that should be there.
Ex. Where @XuserSelect would return

983.859000
983.598000
983.321000

The following code returns
983.859
983.598
983.321


Code
Select All
Var vList as String
Var vStrip as String
Var vNum as Double
Var vEndList as String

vList = @XlistValues("C:\Sesame\Data\Samples\Customers.db", "KEY")

While @Len(vList) > 0
{
	vStrip = Split(vList, ";")
	vNum = @ToNumber(vStrip)
	If @Len(vEndList) > 0 Then
	{
		vEndList = vEndList + ";" + vNum
	}
	Else
	{
		vEndList = vEndList + vNum
	}
}

result = @UserSelect(vEndList)
 

  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged