projects
/
opencv
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Update the changelog
[opencv]
/
apps
/
cvenv
/
EiC
/
stdClib
/
strround.c
1
int strround(char *s,int len)
2
{
3
/* string rounding function
4
* (c) Edmond J. Breen.
5
* round back the numbers in a string
6
* and fill with zeros.
7
* where: 'len' is the length of the string.
8
* Returns 1 on success
9
* and 0 if over flow has occurred.
10
*/
11
if(len>0)
12
if(s[--len] >= '5') {
13
do {
14
s[len--] = '0';
15
} while(len > 0 && s[len] == '9');
16
if(s[len] == '9')
17
return 0;
18
s[len]++;
19
}
20
return 1;
21
}