preventing string conversion to float.

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. #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...
    2. help float to string
      try the sprintf print sprint("%.02f", $f); if I'm not rong; -----Original Message----- From: perl@swanmail.com
    3. #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: ...
    4. #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...
    5. 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?
  3. #2

    Default Re: preventing string conversion to float.

    On Sat, 19 Jul 2003, Little Bill wrote:
    >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'll have to show us some code. The only way I see this happening is if
    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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139