How can I convert a string number to a number in Perl?

Let’s learn how can I convert a string number to a number in Perl. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How can I convert a string to a number in Perl?

How would I convert a string holding a number into its numeric value in Perl?


You don't need to convert it at all: % perl -e 'print "5.45" + 0.1;' 5.55

Read more

Anton at Stack Overflow Mark as irrelevant Undo

Other solutions

MIPS User input string number, convert to integer?

My assignment is prompt for a number string from the user, read the string (hint: syscall) given by the user, convert the string to an integer and store in register $s0. (do not have to worry about error checking for now). Then using syscall instruction...


You need to create a loop to inspect the characters of the string which will all be digits. You also...

Read more

Mike at Yahoo! Answers Mark as irrelevant Undo

PHP - How do I convert a 6byte string storing a 48bit floating point to a number in PHP?

AMOS supports a 48-bit floating point format consisting of a 40-bit mantissa, 8-bit exponent, and a signbit. Because a normalized mantissa always starts with a binary one in the high-order bit, this bit is not stored in the floating point number but...


Try this: $number = unpack('f', $six_byte_string); For more information, see:

Read more

skett197... at Yahoo! Answers Mark as irrelevant Undo

Make Apache recognize Perl!

How can I get my web server to interpret perl I am playing around with perl for the first time in my life. I am using a fedora core 8 machine. It seems to ave all the essentials installed already (apache, php, mySQL, and perl). However, I make a file...


You need to tell Apache how to handle CGI scripts. Rename to perl.cgi, make sure it's executable, and...

Read more

kaozity at Ask.Metafilter.Com Mark as irrelevant Undo

I need to convert decimals to binary and binary to decimals using a 24 bit number conversion system. Help?

I have the source code but I have no idea how to continue. If someone could show me the code and maybe explain why it works that would be awesome!! I'm completely new to this and am having difficulties teaching myself. Here's the source code. I'm using...


Good homework question...

Read more

Batsmyma... at Yahoo! Answers Mark as irrelevant Undo

Why does my C++ output doesn't convert a number into a roman numeral?

include <iostream> #include <string> using namespace std; int main() { int number; string numeral; cout<<"Enter a number: "; cin>> number; if(number ==1) numeral = "I"; else if (number ==5) numeral = "...


Add the following line to your program before the "return 0" cout << number <<...

Read more

Oliepopz at Yahoo! Answers Mark as irrelevant Undo

Beginner at C# Stuck on convert to question?

Im starting to write c# in VCE and in a console application static void Main(string[] args) { double firstNumber, secondNumber; string userName; Console.WriteLine(″Enter your name:″); userName = Console.ReadLine(); Console.WriteLine(&Prime...


I haven't used C# in a while, so forgive me if my terminologies aren't quite correct or exact. The difference...

Read more

Wesley at Yahoo! Answers Mark as irrelevant Undo

Perl script to replace a number with its double?

Hi, I need a perl script to replace a string something like time 10 (number varies) to time 20.can it done using sed or awk command. Whats the best way to do this


It's a fairly simple problem: $string =~ s/(?<=time )([0-9]+)/$1 * 2/e. The (?<=...) construct...

Read more

chetnaya at Yahoo! Answers Mark as irrelevant Undo

C++ error, help me please (cant convert int to int [])?

warGame(w); for function void warGame (int war [ ]) // POST: display the hand of cards { int card3; // card number int s3; // suit number 0 .. 3 int r3; // rank number 0 .. 12 string suits3 [4] = {"Clubs", "Diamonds...


Im assuming this is how you are calling the function right? warGame(w); is the variable "w"...

Read more

Hayden at Yahoo! Answers Mark as irrelevant Undo

Excel - convert clipboard format to text in macro?

Hi, I'm trying to do a simple thing in Excel with help of a macro. The task is to convert a number of the form 01014***** (* are placeholders for different numbers). In the end I want to get the following 100036:11014***** so I have to add the string...


Try adapting this as a macro C4 your number C5 =SUBSTITUTE(C4,"0","100036:1",1)

Read more

Kraftakt at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.