deliminating output of an equasion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lecichy

    deliminating output of an equasion

    Some arthmetical equasion sets a variable e.g. $result to value 40,23425345
    or any other number and what I want is to print this number but with with
    specified number of digits after the coma, not whole number, like 40,23.

    How ?
    Please


  • Matthias Esken

    #2
    Re: deliminating output of an equasion

    "lecichy" <counter@vline. pl> schrieb:
    [color=blue]
    > Some arthmetical equasion sets a variable e.g. $result to value 40,23425345
    > or any other number and what I want is to print this number but with with
    > specified number of digits after the coma, not whole number, like 40,23.[/color]



    Regards,
    Matthias

    Comment

    • Pedro

      #3
      Re: deliminating output of an equasion

      lecichy wrote:[color=blue]
      > Some arthmetical equasion sets a variable e.g. $result to value 40,23425345
      > or any other number and what I want is to print this number but with with
      > specified number of digits after the coma, not whole number, like 40,23.
      >
      > How ?
      > Please[/color]



      For example:
      <?php
      $x = 12340.234253345 ; ### ATTENTION: "." not ","
      echo number_format($ x, 2, ',', '`'); ## outputs 12`340,23
      ?>


      --
      I have a spam filter working.
      To mail me include "urkxvq" (with or without the quotes)
      in the subject line, or your mail will be ruthlessly discarded.

      Comment

      Working...