for   
Save 
Save 
   Join IIUG  

Informix News
16 October 08 - VendorRate - Informix Earns Top Customer Satisfaction Score on VendorRate in Q3... Read
14 August 08 - IIUG.org - Sellout Expected for the 2009 IIUG Informix Conference... Read
29 April 08 - IntelligentEnterprise.com - IBM Informix Upgrade Enhances Clustering, Database Management... Read
29 April 08 - itweek.com - IBM 'Cheetah 2' mauls data costs... Read
28 April 08 - eWeek.com - IBM Uncages Cheetah 2 Data Server... Read
28 April 08 - CNNMoney.com - IBM Helps Clients Reduce Data Management Costs With New Informix Dynamic Server... Read
09 April 08 - CNNMoney.com - MediaSpan Embeds IBM Informix Dynamic Server Software for Delivering News to Print, Web and Wireless Devices... Read
08 April 08 - IT-Director.com - Informix seeks developers... Read
18 February 08 - marketwire.com - Icarus Studios Partners With IBM to Upgrade Performance, Availability for Its Online Games... Read
17 January 08 - eWeek.com - IBM Adds Mac Support to IDS for Higher Education... Read
17 January 08 - informationweek.com - Lotus Notes For iPhone Signals Closer Ties Between IBM, Apple... Read
16 January 08 - marketwire.com - IBM Informix Dynamic Server to Deliver Support for Mac OS X... Read
16 January 08 - internetnews.com - IBM's IDS to Support Mac Platform... Read
28 June 07 - REG Developer - IBM and Informix tie down Cheetah... Read
27 June 07 - CBRonline.com - IBM corrects its own Informix customer figures... Read
14 June 07 - vnunet.com - IBM changes spots with Informix 'Cheetah' database... Read
14 June 07 - eChannelLine - IBM expands scope for IDS... Read
14 June 07 - Resellernews - IBM: Informix database alive and kicking... Read
13 June 07 - DB2 Magazine - Cheetah is now out of the gate... Read
12 June 07 - IBM - IDS 11 release announcement (pdf)... Read
12 June 07 - ChannelWeb Network - IBM Uncages IDS 11, Aka Cheetah, Database... Read
12 June 07 - eWeek.com - IBM's 'Cheetah' Ready to Pounce... Read
12 June 07 - InformationWeek - IBM Unleashes 'Cheetah' Database... Read
12 June 07 - WebWire - IBM Strengthens Database Portfolio With New Informix Dynamic Server... Read
12 June 07 - Intelligent Enterprise - IBM Unveils Informix Upgrade... Read
12 June 07 - ComputerWeekly.com - IBM's Cheetah IDS makes leap to better data centre clustering... Read
12 June 07 - ebiz - IBM Unveils Next Generation Informix Dynamic Server... Read
12 June 07 - computerworld.com - Will 'Cheetah' help IBM's Informix chase down market share?... Read
12 June 07 - Internetnews.com - No Data Can Outrun This 'Cheetah'... Read
12 June 07 - de.internet.com - IBM neuer Datenbank-Server mit Codenamen Cheetah ist fertig... Read
12 June 07 - verifox.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - golem.de - Informix 11 vorgestellt... Read
12 June 07 - Computerwoche.de - IBM stellt neue Informix-Version vor... Read
12 June 07 - IBM.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - Heise - IBM gibt Informix 11 frei... Read
25 May 07 - Taiwan.CNET.com - Local Taiwan Informix user group established... (Chinese language) ... Read
18 May 07 - ChannelWeb Network - IBM Musters Partners For Cheetah Release... Read
18 May 07 - eWeek.com - IBM Looks to 'Cheetah' to Speed Up Blade Servers... Read
7 May 07 - DB2 Magazine - SQL Shortcuts - Use these tricks to generate IDS SQL scripts... Read

Previous news items
 

Home Member Area About IIUG


Resources
IIUG Insider
IIUG Hotspots
IBM-Informix Links
IIUG RSS Feeds
Software Repository
Informix Products
Online Resources
Informix Library
Informix Books
IIUG Banners
Discussion
Technical Special
  Interest Groups

Other Discussion
Community
Events
Webcasts/Chat w Lab
IIUG TV
IIUG Sponsors
Informix Business Directory
IIUG Press Partners
Local User Groups
Rate the Vendor
Job Board
Fun Stuff

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Datablade List Forum

Re: commas in 1000s

Posted By: Donald Payne
Date: Thursday, 22 May 2003, at 10:50 a.m.

In Response To: commas in 1000s (Janine Marriott)

Sorry, don't know any easy way.
The solutions I would try are:

- If using the Web Blade, you could write a tag, say
<?fmtInt intVal="...">
that uses variable processing functions $(STRLEN), $(SUBSTR) and $(CONCAT)
in a loop to build the formatted string:
copy last three (or fewer) digits to new string
While (there are more digits to copy):
prefix new string with comma
copy previous three or fewer digits to new string
done
display new string

- Write a UDR in SPL, using built-in functions LENGTH(), SUBSTR() (or
SUBSTRING()) and concat.
- copy integer to varchar
- Copy last 3 digits to new varchar
- While there are more digits, etc.

- Write a UDR in C, using the standard C library function sprintf().
_Something_ like this [untested!]:

CREATE FUNCTION addCommas (x integer)
RETURNING lvarchar
WITH (not variant, parallelizable)
EXTERNAL FILE
'$INFORMIXDIR/extend/myBlades/addCommas.bld(addCommas_int)
;

addCommas.c:

mi_lvarchar *addCommas_int (mi_integer x)
{
char *c;
mi_lvarchar s = mi_new_var(15); /* for 4-byte int as string, plus
terminating NULL (\0); ~double for INT8 */
c = mi_get_vardata(s);
sprintf(c, "%,i", x);
mi_set_varlen(s, strlen(c)); /* strlen should be at least one
less than 15 */
return s;
}

HTH.
Regards,
- Don

Donald E. Payne -- Sr. IT Specialist
OLTP Practice, Data Management Services, Software Group, IBM
phone / fax / pager 1-212-745-4380 (internal 243-4380)
mobile office: New York, NY
mailing address: 13 Myrtle Ave., Huntington, NY 11743-3506
Certified IBM Informix Professional
http://www.ibm.com/software/data




"Janine Marriott" <bill.marriott@optusnet.com.au>
Sent by: forum.subscriber@iiug.org
05/22/2003 06:59 AM


To: datablade-list@iiug.org
cc:
Subject: commas in 1000s [23]



Hi Everyone,

Just a short question on formatting output.
Does anyone know an easy way to format an integer field so that 1000 =
appears as 1,000
or 1000000 like 1,000,000 when outputted to a browser window?

thanks

Bill




Messages In This Thread

  • commas in 1000s
    Janine Marriott -- Thursday, 22 May 2003, at 6:59 a.m.
    • Re: commas in 1000s
      Donald Payne -- Thursday, 22 May 2003, at 10:50 a.m.
    • Re: commas in 1000s
      Janine Marriott -- Friday, 23 May 2003, at 6:21 p.m.

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Datablade List Forum is maintained by Administrator with WebBBS 5.12.

©2001 - 2007 International Informix Users Group.   All rights reserved.     Terms of use    
*** Powered By IBM Informix Dynamic Server V10.00 ***