#39830 [NEW]: Incorrect (float) variable output after using setlocale

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #39830 [NEW]: Incorrect (float) variable output after using setlocale

    From: ipa at beta dot lt
    Operating system: Linux 2.6.10
    PHP version: 4.4.4
    PHP Bug Type: Variables related
    Bug description: Incorrect (float) variable output after using setlocale

    Description:
    ------------
    Strange behaviour on float variable output after using setlocale()
    function.

    Reproduce code:
    ---------------
    <?php

    setlocale(LC_NUMERIC, 'lt_LT');

    $xxx = 19.48;
    echo ($xxx) . "\n"; // Output float from variable
    echo (19.48) . "\n"; // Output float directly
    ?>

    Expected result:
    ----------------
    19,48
    19,48

    Actual result:
    --------------
    19,48
    19.48

    --
    Edit bug report at [url]http://bugs.php.net/?id=39830&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39830&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39830&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39830&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39830&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=39830&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=39830&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39830&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=39830&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=39830&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=39830&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=39830&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=39830&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=39830&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39830&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=39830&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=39830&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39830&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=39830&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39830&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39830&r=mysqlcfg[/url]
    ipa at beta dot lt Guest

  2. Similar Questions and Discussions

    1. #40423 [NEW]: -INF float session variable
      From: jwprox at hotmail dot com Operating system: OSX 10.4 PHP version: 4.4.4 PHP Bug Type: Session related Bug description:...
    2. #8097 [Com]: printf() and float data vs.setlocale()
      ID: 8097 Comment by: essen at dev-extend dot eu Reported By: hh at loca dot net Status: No Feedback Bug Type: ...
    3. #24640 [Asn->Csd]: var_export and var_dump can't output large float
      ID: 24640 Updated by: helly@php.net Reported By: gharman at erols dot com -Status: Assigned +Status: ...
    4. #24640 [Opn->Asn]: var_export and var_dump can't output large float
      ID: 24640 Updated by: sniper@php.net Reported By: gharman at erols dot com -Status: Open +Status: ...
    5. #24640 [NEW]: var_export and var_dump can't output large float
      From: gharman at erols dot com Operating system: XP & Linux PHP version: 4.3.2 PHP Bug Type: Variables related Bug...
  3. #2

    Default #39830 [Opn->Fbk]: Incorrect (float) variable output after using setlocale

    ID: 39830
    Updated by: [email]tony2001@php.net[/email]
    Reported By: ipa at beta dot lt
    -Status: Open
    +Status: Feedback
    Bug Type: Variables related
    Operating System: Linux 2.6.10
    PHP Version: 4.4.4
    New Comment:

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]

    Cannot reproduce.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-14 09:58:01] ipa at beta dot lt

    Description:
    ------------
    Strange behaviour on float variable output after using setlocale()
    function.

    Reproduce code:
    ---------------
    <?php

    setlocale(LC_NUMERIC, 'lt_LT');

    $xxx = 19.48;
    echo ($xxx) . "\n"; // Output float from variable
    echo (19.48) . "\n"; // Output float directly
    ?>

    Expected result:
    ----------------
    19,48
    19,48

    Actual result:
    --------------
    19,48
    19.48


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39830&edit=1[/url]
    tony2001@php.net 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