GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
trim_dec.c
Go to the documentation of this file.
1
17
#include <string.h>
18
#include <grass/gis.h>
19
20
30
int
G_trim_decimal
(
char
*buf)
31
{
32
char
*mark;
33
34
/* don't trim e+20 into e+2 */
35
if
( strchr(buf,
'e'
) || strchr(buf,
'E'
) )
36
return
0;
37
38
/* find the . */
39
while
(*buf !=
'.'
)
40
if
(*buf++ == 0)
41
return
0;
42
43
mark = buf;
44
while
(*++buf)
45
if
(*buf !=
'0'
)
46
mark = buf + 1;
47
*mark = 0;
48
49
return
0;
50
}
lib
gis
trim_dec.c
Generated on Wed Jun 6 2012 14:04:29 for GRASS Programmer's Manual by
1.8.1