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

Re^2: acme::tools num2code function

by cztmonk (Monk)
on Jun 11, 2012 at 09:12 UTC ( [id://975529]=note: print w/replies, xml ) Need Help??


in reply to Re: acme::tools num2code function
in thread acme::tools num2code function

Thanks, good explanation. I've learned something new today.

$number=5; $code=num2code($number, 10, 'AB'), print $code ,"\n";

it results in this output:

AAAAAAABAB

thanks again

Replies are listed 'Best First'.
Re^3: acme::tools num2code function
by zentara (Archbishop) on Jun 11, 2012 at 10:29 UTC
    I've learned something new today

    Along the same line of thought, you may be interested in Math::BaseCnv

    #!/usr/bin/perl use warnings; use strict; use Math::BaseCnv; #fast # Convert 63 from base-10 (decimal) to base-2 (binary) # $binary_63 = cnv( 63, 10, 2 ); my $time = time; print "time -> $time\n"; my $time_128 = cnv( $time, 10, 128 ); print "time_128 -> $time_128\n"; #this will sometimes print hidden newlines my $time_10 = cnv( $time_128, 128, 10 ); print "time_10 -> $time_10\n"; my $time_64 = cnv( $time, 10, 64 ); print "time_64 -> $time_64\n"; my $time_b64 = cnv( $time, 10, 'b64' ); print "time_b64 -> $time_b64\n"; exit;

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
      Thanks for this hint.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-28 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found