Re: [U2] Scientific Notation
OCONV(OCONV(var,'MCN'),'MR2') should do the trick. Doug Farmer wrote: Good Day All! Does anyone know of a UniData function or ICONV option to convert scientific notation to a decimal number. We are receiving some numbers in an XML packet from a 3rd party where sometimes Scientific Notation is used, instead of a decimal value. For example, instead of 5 cents coming in from the XML as .05, the XML contains 4.89E-02. This is due to a percentage calculation in a SQL data base. There is no way I can change the XML Generation software, so I must deal with it on the UniData side. Thanks Doug This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software Corporation or any other company within its group. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Scientific Notation
Actually, that gives you the wrong number (it gives you 489.00). Try this instead: OCONV(ICONV(FIELD(var,E,1),'MR4'),'MR4')*(10^FIELD(var,E,2)) Note that MR4 is for precision 4. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mecki Foerthmann Sent: Friday, April 18, 2008 1:54 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Scientific Notation OCONV(OCONV(var,'MCN'),'MR2') should do the trick. Doug Farmer wrote: Good Day All! Does anyone know of a UniData function or ICONV option to convert scientific notation to a decimal number. We are receiving some numbers in an XML packet from a 3rd party where sometimes Scientific Notation is used, instead of a decimal value. For example, instead of 5 cents coming in from the XML as .05, the XML contains 4.89E-02. This is due to a percentage calculation in a SQL data base. There is no way I can change the XML Generation software, so I must deal with it on the UniData side. Thanks Doug This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software Corporation or any other company within its group. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Scientific Notation
One more note on this, just to make it a bit more robust... If there is any likelihood of the E being lower case (e), then replace var in both cases with OCONV(var,'MCU'). Also, if you copy/paste it into the editor, you may have to double up the ^ character or the editor thinks it's a prefix for a numeric character value. Enjoy! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Houben Sent: Friday, April 18, 2008 2:38 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Scientific Notation Actually, that gives you the wrong number (it gives you 489.00). Try this instead: OCONV(ICONV(FIELD(var,E,1),'MR4'),'MR4')*(10^FIELD(var,E,2)) Note that MR4 is for precision 4. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mecki Foerthmann Sent: Friday, April 18, 2008 1:54 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Scientific Notation OCONV(OCONV(var,'MCN'),'MR2') should do the trick. Doug Farmer wrote: Good Day All! Does anyone know of a UniData function or ICONV option to convert scientific notation to a decimal number. We are receiving some numbers in an XML packet from a 3rd party where sometimes Scientific Notation is used, instead of a decimal value. For example, instead of 5 cents coming in from the XML as .05, the XML contains 4.89E-02. This is due to a percentage calculation in a SQL data base. There is no way I can change the XML Generation software, so I must deal with it on the UniData side. Thanks Doug This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software Corporation or any other company within its group. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Scientific Notation
Ah, you had my hopes up. But X = '4.89E-02' PRINT OCONV(OCONV(X,'MCN'),'MR2') Gives me 489.02 It should come back as .05 (after rounding) Doug -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mecki Foerthmann Sent: Friday, April 18, 2008 3:54 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Scientific Notation OCONV(OCONV(var,'MCN'),'MR2') should do the trick. Doug Farmer wrote: Good Day All! Does anyone know of a UniData function or ICONV option to convert scientific notation to a decimal number. We are receiving some numbers in an XML packet from a 3rd party where sometimes Scientific Notation is used, instead of a decimal value. For example, instead of 5 cents coming in from the XML as .05, the XML contains 4.89E-02. This is due to a percentage calculation in a SQL data base. There is no way I can change the XML Generation software, so I must deal with it on the UniData side. Thanks Doug This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software Corporation or any other company within its group. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software Corporation or any other company within its group. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/