473,385 Members | 1,647 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,385 software developers and data experts.

function returning a readable representation of a number

Is there any postgres function that do the following:

select func(9123456789);
9 123 456 789

the function is given a number and it returns a "readable" string representation of the number seperating groups of 3 numbers by spaces.

Thx
Nov 23 '05 #1
3 1296
From: Najib Abi Fadel
To: generalpost
Sent: Tuesday, July 13, 2004 10:07 AM
Subject: [GENERAL] function returning a readable representation of a number
Is there any postgres function that do the following:

select func(9123456789);
9 123 456 789


you mean like

select to_char(9123456789,'999 999 999 999');

?

gnari
Nov 23 '05 #2
Nope.

You can create one though.

Mike

On Tue, Jul 13, 2004 at 12:07:17PM +0200, Najib Abi Fadel wrote:
Is there any postgres function that do the following:

select func(9123456789);
9 123 456 789

the function is given a number and it returns a "readable" string representation of the number seperating groups of 3 numbers by spaces.

Thx


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3
CoL
hi,

Najib Abi Fadel wrote:

Is there any postgres function that do the following:

select func(9123456789);
9 123 456 789

the function is given a number and it returns a "readable" string
representation of the number seperating groups of 3 numbers by spaces.


you can write it for your own, but here is one:
http://gear.hu/files/resources/postg...ber_format.sql

C.
Nov 23 '05 #4

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

Similar topics

41
by: Materialised | last post by:
I am writing a simple function to initialise 3 variables to pesudo random numbers. I have a function which is as follows int randomise( int x, int y, intz) { srand((unsigned)time(NULL)); x...
15
by: Earth | last post by:
Hi all, I am new to c and trying the sprintf function. I have written a testing program to try the sprintf fuction and expect the output is 1.234. However, the output shows nothing. Am I...
15
by: Daniel Rudy | last post by:
Hello, Consider the following code: /* resolve_hostname this resolves the hostname into an ip address. */ static void resolve_hostname(char result, const char hostname, const char server) {
42
by: baumann | last post by:
hi all, typedef int (*pfunc)(int , int); pfunc a_func; i know it's ok, but how can define a_func without typedef statement? thanks .
27
by: Luke Wu | last post by:
Is there a C function that returns the number of digits in an input int/long? example: numdigits(123) returns 3 numdigits(1232132) returns 7
8
by: Adam Scheinberg | last post by:
Hello all, This is my first post and I'm wondering if someone can point me in the right direction. I have seen the following code MANY times in programs and throughout the internet: <?php...
6
by: Matthew Cook | last post by:
I would like to overload the unary minus operator so that I can negate an instance of a class and pass that instance to a function without creating an explicit temporary variable. Here is an...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
49
by: Davy | last post by:
Hi all, I am writing a function, which return the pointer of the int. But it seems to be wrong. Any suggestion? int * get_p_t(int t) { return &t; } int main()
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.