On Mon, 2004-08-09 at 14:53, David Dorward wrote:
> On 9 Aug 2004, at 14:34, SilverFox wrote:
> 
> > Hi all, I'm trying to writing a script that will allow a user to enter 
> > a
> > number and that number will be converted into KB,MB or GB depending on 
> > the
> > size of the number. Can someone point me in the right direction?
> 
> What have you got so far? Where are you stuck? Getting user input 
> (where from)? Working out which order of magnitude the number is?

I wouldn't do that (the part of finding the order of magnitude)... I
would probably keep on doing calculations while the numbers was greater
then 1024... and in the end, when it was, the right letter to append
would be based on the amount of calculations done...

I remember reading something about this on use.Perl ... it was a while
ago, and I'm not sure whether it ever got into a module, but the guy had
written some wonderful code to do this :-)

> Converting between kilo and mega et al? Showing the output?
> 
> Show us some code.
> 
> --
> David Dorward
>       <http://dorward.me.uk/>
> <http://blog.dorward.me.uk/>
-- 
José Alves de Castro <[EMAIL PROTECTED]>
  http://natura.di.uminho.pt/~jac

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to