|
|
Re: How to convert Exponent into pure number [message #204957 is a reply to message #204953] |
Wed, 22 November 2006 21:39 |
|
These are number type in database and thats's the way I see it. When I get those data thru forms and export it on excel, still it looks the same. The user needs to convert that excel column just to see the long numbers. I need to convert it before exporting.
|
|
|
|
|
Re: How to convert Exponent into pure number [message #205056 is a reply to message #204953] |
Thu, 23 November 2006 03:01 |
|
That won't do david. see the difference on output and the real value of the number .. 4404530000000000 vs 337670137917014.00
Data type in database is number(16)
Yes, the user can format the excel cell and can achieve the desired output. But they're too lazy. Anyway I put my stand that it wasn't possible for now and they have to do it.
Still I have to know this one for future use.
Thanks!
|
|
|
Re: How to convert Exponent into pure number [message #205184 is a reply to message #205056] |
Thu, 23 November 2006 17:24 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
4404530000000000 and 4404530000000000.00 are the same NUMBER. They are ONLY different if you put them out as a CHARACTER string and to do that use formatting and prefix the value with a double quote.
SQL> select '"'||ltrim(to_char(4.40453E+15,'999,999,999,999,999,990.99')) from dual;
'"'||LTRIM(TO_CHAR(4.40453E+
----------------------------
"4,404,530,000,000,000.00
David
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to convert Exponent into pure number [message #205849 is a reply to message #204953] |
Mon, 27 November 2006 22:56 |
|
I use hiiden field this time with format mask '999999999999999' then I pass the value in it. I can now write the number coorectly to excel, but to prevent excel to format it back to 3.3767E+14, I write single quote before the numbers(eg. char(39) || my_number).
The problem is, the field must be in number format,not in char, so I must omit that single quote. Then I don't know if oracle can format or manipulate excel.
|
|
|
|
|
|
|
Re: How to convert Exponent into pure number [message #206125 is a reply to message #204953] |
Tue, 28 November 2006 20:07 |
|
Hi,
It's working but rounding off numbers.
eg:4921611068862010 instead of 4921611068862009
Aside from this, I'm using DDE.POKE to write in excel and not the like of
ole2.set_property(ExcelCellId, 'Value', :t.a_anumber); .
I'm having trouble trying to adjust my code.
|
|
|
|
|
Re: How to convert Exponent into pure number [message #206188 is a reply to message #204953] |
Wed, 29 November 2006 02:03 |
|
Instead of numberformat like this
OLE2.SET_PROPERTY(ExcelCellId, 'NumberFormat', '#####' );
I need 'text' format. This will solve my problem on 16digits entry. The default of excel is general format.
Somebody here can help me? I can't find any in internet.
|
|
|
|
Re: How to convert Exponent into pure number [message #206619 is a reply to message #204953] |
Thu, 30 November 2006 19:26 |
|
Double quote won't do it, I use single qoute using chr(39). The output is '1234567898765432. That is correct but I have to omit that quote. The only way I think is to format the excel cells into text so that anything I write into it will displat as is.
|
|
|
|
|
|
|
Re: How to convert Exponent into pure number [message #207051 is a reply to message #204953] |
Mon, 04 December 2006 00:41 |
|
Yes David, it will return the correct numbers. But my boss don't want that formula seen on top.
Anyway, I solved my problem on this and I want to share to everyone here. I format the third comlumn on excel to make it text so it can display what entered as is.
cols := OLE2.GET_OBJ_PROPERTY(application, 'Columns');
ExcelArgs := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(ExcelArgs, 'C:C');
rng := OLE2.GET_OBJ_PROPERTY(cols, 'Item', ExcelArgs);
OLE2.DESTROY_ARGLIST(ExcelArgs);
OLE2.SET_PROPERTY(rng, 'NumberFormat', '@'); --text format
Thanks David and to all participated in this thread.
Cheers!
[Updated on: Mon, 04 December 2006 00:43] Report message to a moderator
|
|
|
|