Decimal Conversion

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Tlam
Participant
Posts: 16
Joined: Thu Aug 23, 2007 12:56 am

Decimal Conversion

Post by Tlam »

Hi,

Hope some can help me with below conversion. I have tried to search for a soultion but I couldn't find it.

This amount will come from the source 1.250,60 and I need to transform it to 1250.60

Please advice me how or where to look for this to help me further.

Thanks

Tlam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There are probably other ways, but I'd bring it in as a string, remove all the 'punctionation' and then divide by 100:

Code: Select all

Convert(",.","",LinkName.FieldName) / 100
-craig

"You can never have too many knives" -- Logan Nine Fingers
Tlam
Participant
Posts: 16
Joined: Thu Aug 23, 2007 12:56 am

Post by Tlam »

I tried with Iconv and Oconv Mask Decimal function, with no luck.

some amount will be converted like this

1.250,09 -> 125009.00
1039.01 - > 1.04
Tlam
Participant
Posts: 16
Joined: Thu Aug 23, 2007 12:56 am

Post by Tlam »

chulett wrote:There are probably other ways, but I'd bring it in as a string, remove all the 'punctionation' and then divide by 100:

Code: Select all

Convert(",.","",LinkName.FieldName) / 100[/c ...[/quote]

I will try if this helps. Thanks for the advice.
Tlam
Participant
Posts: 16
Joined: Thu Aug 23, 2007 12:56 am

Post by Tlam »

chulett wrote:There are probably other ways, but I'd bring it in as a string, remove all the 'punctionation' and then divide by 100:

Code: Select all

Convert(",.","",LinkName.FieldName) / 100[/c ...[/quote]

Chulett, thanks for the advice, it worked.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Excellent, please mark the topic as Resolved in that case.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply