Decimal point comma to dot

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
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Decimal point comma to dot

Post by jusami25 »

Hi experts,

I'm getting from the database the value "0,8" and i want to multiply this number with another one. The problem is that i getting a phantom error because the decimal separator mush be . instead of ,

There is a way to do it using the Oconv or Iconv functions? I have tried with Oconv(Iconv("0,8", "MD2P"), "MD2P") but i'm getting 8.000000000

Thanks in advance.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use Ereplace() or Convert() to change comma to dot.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Post by jusami25 »

Thanks for the quick answer DSguru2B.

I know i can do it using these two functions.

I just wan't to know wheter it's possible to do it using the Oconv or Iconv functions, and how to do it?

Thanks again :D
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In order to stay with numbers, you can use a combination of OCONV and ICONV to effect this, the first converts from the format "1.000.000,00" to "100000000" and the second converts to the format "1,000,000.00" staying with numeric formats. Or use a CONVERT(',.','.,',"8,02") to pretty much do the same thing.
Post Reply