Page 1 of 1

StringToDecimal - how to avoid to Rounding

Posted: Thu Dec 16, 2010 2:25 pm
by anu123
I have source field geocode and value as below..
source - Geocode = 40.145000|-84.24860

I need to parse above value into Latitude & Longitude

Latitude = 40.145
Longitude = -84.2486

I am using below transformations

Latitude = StringToDecimal(Field(geocode,"|",1))
Longitude = StringToDecimal(Field(geocode,"|",2))

The outpur I am getting is

Latitude = 40.145
Longitude = -84.249

I tried using using RTYPE option 'floor' on StringToDecimal but values are getting truncated.

Is there a way to convert string to decimal with any kind of rounding..

Posted: Thu Dec 16, 2010 3:26 pm
by ray.wurlod
Specify a larger scale value than 3.

Posted: Thu Dec 16, 2010 3:33 pm
by anu123
ray.wurlod wrote:Specify a larger scale value than 3.
Thanks Ray.

I have specified Decimal(31,10). Even though it is getting rounded.