writing long numbers with delimiters

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

    writing long numbers with delimiters

    for no particular reason at this very moment, I would like to echo
    numebrs of seconds since my site is born. or since I'm born. this isn't
    problem ($diff = time() - mktime($beginin g) but it looks ugly on screen:

    using this two functions substr(chunk_sp lit($diff, 3, '.'), 0, -1);
    I'm lucky with my site: 277142273 seconds = 277.142.273
    but with myself: 1257865147 seconds = 125.786.514.7

    so I would like to echo 1.257.865.167 ...can someone help me with this?

    (I know I have seen it somewhere before, but now I can't find where)
    thank you! :)

    --
    Ja NE
    fotografija = zapisano svjetlom | fotozine = foto-e-zin

    --
  • Rami Elomaa

    #2
    Re: writing long numbers with delimiters

    Ja NE kirjoitti:
    for no particular reason at this very moment, I would like to echo
    numebrs of seconds since my site is born. or since I'm born. this isn't
    problem ($diff = time() - mktime($beginin g) but it looks ugly on screen:
    >
    using this two functions substr(chunk_sp lit($diff, 3, '.'), 0, -1);
    I'm lucky with my site: 277142273 seconds = 277.142.273
    but with myself: 1257865147 seconds = 125.786.514.7
    >
    so I would like to echo 1.257.865.167 ...can someone help me with this?
    >
    (I know I have seen it somewhere before, but now I can't find where)
    thank you! :)
    >
    number_format()


    By thw way, if you wanted to use chunk_split and substr, you should
    first reverse the string, then chunksplit it, then reverse again to get
    correct separation for the numbers. ;)

    --
    Rami.Elomaa@gma il.com
    "Olemme apinoiden planeetalla."

    Comment

    • Tyrone Slothrop

      #3
      Re: writing long numbers with delimiters

      On Sun, 18 Mar 2007 15:02:10 +0100, hidden@mail.zz (Ja NE) wrote:
      >for no particular reason at this very moment, I would like to echo
      >numebrs of seconds since my site is born. or since I'm born. this isn't
      >problem ($diff = time() - mktime($beginin g) but it looks ugly on screen:
      >
      >using this two functions substr(chunk_sp lit($diff, 3, '.'), 0, -1);
      >I'm lucky with my site: 277142273 seconds = 277.142.273
      >but with myself: 1257865147 seconds = 125.786.514.7
      >
      >so I would like to echo 1.257.865.167 ...can someone help me with this?
      >
      >(I know I have seen it somewhere before, but now I can't find where)
      >thank you! :)
      >
      >--
      >Ja NE
      >http://fotozine.org/?omen=janimir
      number_format() is what you are looking for.

      Comment

      • Ja NE

        #4
        Re: writing long numbers with delimiters

        Tyrone Slothrop <ts@paranoids.c omwrote:
        >
        number_format() is what you are looking for.
        tnx :)

        --
        Ja NE
        fotografija = zapisano svjetlom | fotozine = foto-e-zin

        --

        Comment

        • Ja NE

          #5
          Re: writing long numbers with delimiters

          Rami Elomaa <rami.elomaa@gm ail.comwrote:
          tnx :)

          --
          Ja NE
          fotografija = zapisano svjetlom | fotozine = foto-e-zin

          --

          Comment

          Working...