Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Parse float from string

by gryphon (Abbot)
on Nov 05, 2002 at 17:31 UTC ( [id://210522]=note: print w/replies, xml ) Need Help??


in reply to Parse float from string

You know, this really seems like it ought to be a really basic function in Perl. Perl is uber-powerful with text manipulation, why not add just a simple "make number" function? JavaScript does this. The "parseInt" and "parseFloat" functions are extremely useful. Maybe this belongs in meditations, but Perl's ability to think of scalars as either numbers of strings can be both useful and annoying at the same time. Maybe this is something to add into Perl 6?

Update: OK, I'm an idiot. Nevermind.

gryphon
code('Perl') || die;

Replies are listed 'Best First'.
Re: Re: Parse float from string
by rasta (Hermit) on Nov 06, 2002 at 08:37 UTC
    The function you are talking about already exists, it is strtod() from POSIX module.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found