money_format(); [Error]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    money_format(); [Error]

    my coding
    Code:
    $productamount = money_format('%.2n',$productamount);
    $totalamount = ($userproductqty * $productamount);
    Error occured is
    Fatal error: Call to undefined function: money_format()
    i am new to php, i dont know to handle money_format(); , guide me with suitable example.
  • cassbiz
    New Member
    • Oct 2006
    • 202

    #2
    Originally posted by nirmalsingh
    my coding
    Code:
    $productamount = money_format('%.2n',$productamount);
    $totalamount = ($userproductqty * $productamount);
    Error occured is
    Fatal error: Call to undefined function: money_format()
    i am new to php, i dont know to handle money_format(); , guide me with suitable example.
    I just read up on a tutorial regarding money format and #1 if you are running on a windows server it will not work.

    here is the way the code should be formatted.

    [php]
    <?php
    $number = 1234.56;
    setlocale(LC_MO NETARY, "en_US");
    echo money_format("T he price is %i", $number);
    ?>
    [/php]

    The output would be "The price is $1,234.56"

    Here is a link to the tutorial

    Good luck

    Comment

    Working...