Ask a Question related to PERL Miscellaneous, Design and Development.
-
Little Bill #1
preventing string conversion to float.
It has been a long time since I touched any perl, and I am having a
problem with parsing a text file. I need to pull out a string in the
form 1234-5678-9123. My problem is that perl want to interpolate this
as three numbers and then it does the subtraction.
Is there a way to prevent the interpolation as a float?
Any help would be appreciated.
LB
Little Bill Guest
-
#39126 [NEW]: String->float->String conversion behavior
From: bobson at rpg dot pl Operating system: Linux PHP version: 5CVS-2006-10-11 (snap) PHP Bug Type: Unknown/Other Function... -
help float to string
try the sprintf print sprint("%.02f", $f); if I'm not rong; -----Original Message----- From: perl@swanmail.com -
#25562 [Opn->Bgs]: Float to String to Float conversion error
ID: 25562 Updated by: helly@php.net Reported By: daseymour at 3hc dot org -Status: Open +Status: ... -
#25562 [NEW]: Float to String to Float conversion error
From: daseymour at 3hc dot org Operating system: and PHP version: 4.3.3 PHP Bug Type: Math related Bug description: Float... -
How to convert string to float?
i want to covert a querystring to float number in asp. what function should i use? i know cint() can convert string to int but how about float? -
Jeff 'japhy' Pinyan #2
Re: preventing string conversion to float.
On Sat, 19 Jul 2003, Little Bill wrote:
You'll have to show us some code. The only way I see this happening is if>It has been a long time since I touched any perl, and I am having a
>problem with parsing a text file. I need to pull out a string in the
>form 1234-5678-9123. My problem is that perl want to interpolate this
>as three numbers and then it does the subtraction.
>
>Is there a way to prevent the interpolation as a float?
you eval() the string containing the numbers.
--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
Jeff 'japhy' Pinyan Guest



Reply With Quote

