GRASS Programmer's Manual  6.4.1(2011)
commas.c File Reference

GIS Library - Comma string functions. More...

#include <string.h>
#include <grass/gis.h>
Include dependency graph for commas.c:

Go to the source code of this file.

Functions

int G_insert_commas (char *buf)
 Inserts commas into a number string.
int G_remove_commas (char *buf)
 Removes commas from number string.

Detailed Description

GIS Library - Comma string functions.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
GRASS GIS Development Team
Date:
1999-2008

Definition in file commas.c.


Function Documentation

int G_insert_commas ( char *  buf)

Inserts commas into a number string.

Examples:

  • 1234567 becomes 1,234,567
  • 1234567.89 becomes 1,234,567.89
  • 12345 becomes 12,345
  • 1234 stays 1234

Note: Does not work with negative numbers.

Parameters:
[in,out]bufstring
Returns:
1 if no commas inserted
0 if commas inserted

Definition at line 38 of file commas.c.

int G_remove_commas ( char *  buf)

Removes commas from number string.

Examples:

  • 1,234,567 becomes 1234567
  • 1,234,567.89 becomes 1234567.89
  • 12,345 becomes 12345
  • 1234 stays 1234
Parameters:
[in,out]bufstring
Returns:
always returns 0

Definition at line 88 of file commas.c.

References b.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines