Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: excel format problem

by davies (Prior)
on Sep 03, 2014 at 17:43 UTC ( [id://1099444]=note: print w/replies, xml ) Need Help??


in reply to Re^2: excel format problem
in thread excel format problem

Excel's hex converter certainly used to be limited to numbers less then 512. I also believe that the OP is using Spreadsheet::WriteExcel or something from that stable rather than Win32::OLE, otherwise I would rush my BigInt xla out & suggest he used that, but I understand that it's a problem importing modules into Excel files using S:WE or its derivatives.

Regards,

John Davies

Replies are listed 'Best First'.
Re^4: excel format problem
by Laurent_R (Canon) on Sep 03, 2014 at 17:50 UTC
    Hi, thank you, I did not know the Excel conversion function was limited to 512, but I did not see anyway an easy way to use it within the context of a Perl program. Just another good reason to convert the numbers into decimal notation using Perl, before populating the spreadsheet (choroba's suggestion).
Re^4: excel format problem
by mark4444az (Sexton) on Sep 03, 2014 at 21:05 UTC
    Actually, I think that literally putting "0x" at the beginning made it from a number to a string and now Excel leaves it alone.

      Yes, but now Excel will ignore it as a number. For example, with cell B4 containing =SUM(B1:B3):

      AB
      1 1
      2 0x2
      3 3
      4 Total: 4

      — the total is 4, not 6 as expected. As a rule, numerical data entered into an Excel spreadsheet should be available to be used as numerical data — that’s what a spreadsheet is for, after all! So, prefer choroba’s approach given above.

      Hope that helps,

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Re^4: excel format problem
by mark4444az (Sexton) on Sep 03, 2014 at 20:26 UTC
    Actually, this seems to have worked:
    $hex_data = "0x".$hex_data;
    That forces an 0x on the values that I print to Excel. That seems to be working.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1099444]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-18 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found