|Don't ask to ask, just ask|
Print Number With Implied Decimal Pointby j355ga (Initiate)
|on Apr 18, 2012 at 13:50 UTC||Need Help??|
j355ga has asked for the
wisdom of the Perl Monks concerning the following question:
I need to have a very efficient method of placing an implied decimal point after converting a binary field.
The binary file is extracted from a very large database. File could be 500 million rows so extreme efficiency is key. Converting the data from within the database is not an option.
Extracted database file contains a 16 byte binary number equivalent to hex "000000000000d3c21bcecceda0ffff9c" this converts to decimal 999999999999999999999900
The format of this field is decimal(24,2) thus I want to print 9999999999999999999999.00
Substr would work but is tedious and I don't believe printf can insert an implied decimal point. Any other ideas?