Page 1 of 1

Decimal point comma to dot

Posted: Tue Jan 23, 2007 9:55 am
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.

Posted: Tue Jan 23, 2007 9:57 am
by DSguru2B
Use Ereplace() or Convert() to change comma to dot.

Posted: Tue Jan 23, 2007 10:03 am
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

Posted: Tue Jan 23, 2007 10:21 am
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.