473,412 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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($begining) but it looks ugly on screen:

using this two functions substr(chunk_split($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
--
Mar 18 '07 #1
4 1900
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($begining) but it looks ugly on screen:

using this two functions substr(chunk_split($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()
http://fi2.php.net/manual/en/function.number-format.php

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. ;)

--
Ra*********@gmail.com
"Olemme apinoiden planeetalla."
Mar 18 '07 #2
On Sun, 18 Mar 2007 15:02:10 +0100, hi****@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($begining) but it looks ugly on screen:

using this two functions substr(chunk_split($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.
Mar 18 '07 #3
Tyrone Slothrop <ts@paranoids.comwrote:
>
number_format() is what you are looking for.
tnx :)

--
Ja NE
http://fotozine.org/?omen=janimir
--
Mar 18 '07 #4
Rami Elomaa <ra*********@gmail.comwrote:
number_format()
http://fi2.php.net/manual/en/function.number-format.php
tnx :)

--
Ja NE
http://fotozine.org/?omen=janimir
--
Mar 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: rob | last post by:
hey every1, I've got alot of data to write out to file and it's all just 1's and 0's. It's all stored in 2 dimensional arrays of width 32 and varying height. At the moment it's all just...
3
by: Romain | last post by:
Hello, I am writing out a binary file. I figured that the number "10" is automaticaly converted to "OD OA" instead of "OD". "OD" and "OA" are line feed and carriage return. I know it does...
19
by: Eduardo Bezerra | last post by:
Hi, I'm looking for an efficient way to create the oposite of a list of numbers. For example, suppose I have this list of numbers: 100 200 300
3
by: Ike | last post by:
Anyone know of a quick method to make numbers input from a textbox work with math. For example, if I have a text box where people might enter a value like: $567,000.23 I want to work with...
3
by: MLH | last post by:
I found some code Dev Ashish posted nearly a decade ago in response to someone's inquiry describing their need to dial a number, monitor call progress and determine whether it was busy. This was...
2
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
4
by: sherifffruitfly | last post by:
Hi all, I've got a csv file for numeric data, some of which are greater than 10^3. Some bright fellow trying to br helpful put US-standard commas in these numbers, and to maintain the correct...
17
by: Tarique | last post by:
This program was compiled on MS Visual C++ 08 /*Fibonacci Numbers*/ #include<stdio.h> #include<limits.h> void fibonacci(int n) { unsigned long long fib0 = 0; /*First Fibonacci Number*/
6
m6s
by: m6s | last post by:
1. After hours of researching, I used these snippets : void Object::TokenizeLines(const string& str, vector<string>& tokens, const string& delimiters) // Skip delimiters at beginning....
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.