Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: generating ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 11025 of 11526
Post > Topic >>

Re: generating number ranges using rand function

by krahnj@[EMAIL PROTECTED] (John W. Krahn) May 4, 2008 at 01:43 PM

Aruna Goke wrote:
> I have worked on the code below and am able to generate the 15digit 
> lenght required .
> 
> However, what i wish to achieve is to make sure all the output comes out

> in 15 digits each. a sample of my output is as below.
> 
> Can someone guide on how to make all come out in 15digits.

print sprintf( '%.30f', rand ) =~ /\.(\d{15})/;


John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall
 




 6 Posts in Topic:
generating number ranges using rand function
myklass@[EMAIL PROTECTED]  2008-05-04 16:09:53 
Re: generating number ranges using rand function
noreply@[EMAIL PROTECTED]  2008-05-04 17:54:05 
Re: generating number ranges using rand function
Jenda@[EMAIL PROTECTED]   2008-05-04 18:38:43 
Re: generating number ranges using rand function
krahnj@[EMAIL PROTECTED]   2008-05-04 13:43:52 
Re: generating number ranges using rand function
myklass@[EMAIL PROTECTED]  2008-05-04 23:48:28 
Re: generating number ranges using rand function
rob.dixon@[EMAIL PROTECTE  2008-05-05 14:16:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 11:41:01 CDT 2008.