473,770 Members | 4,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
http://fotozine.org/?omen=janimir
--
Mar 18 '07 #1
4 1919
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()
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*********@gma il.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($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.
Mar 18 '07 #3
Tyrone Slothrop <ts@paranoids.c omwrote:
>
number_format() is what you are looking for.
tnx :)

--
Ja NE
http://fotozine.org/?omen=janimir
--
Mar 18 '07 #4
Rami Elomaa <ra*********@gm ail.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
5565
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 integer arrays and the individual 1's and 0's are being written out as integers.
3
5505
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 that if the file is opened in something else than in binary mode. But in my example below, the file is really opened in binary.
19
2126
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
1228
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 only 567000.23 Is there an easy way to do that? Thanks, Ike
3
2677
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 back when A2.0 was more widely used, so the code is Access Basic. Autodialer is not the answer, as it requires users to take handsets off-hook manually. I find myself in need of more direct control of a voice/data/fax modem from an A97 program....
2
6860
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 replace just one item. I know I can get the entire array, then save the whole thing (with a for loop and if statements so that the changed data will be saved), but it seems like a lot of unnecessary reading and writing. Is there a way to directly save...
4
25226
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 cell-index put quotation marks around the comma'd result. Example csv line: 43.56,345.2,"1,285,100",45.6
17
7564
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
4248
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. string::size_type lastPos = str.find_first_not_of(delimiters, 0); // Find first "non-delimiter". string::size_type pos = str.find_first_of(delimiters, lastPos); while (string::npos != pos || string::npos != lastPos) { // Found a token, add it...
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8886
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.