New mail system, with inbox OLC, index rebuilder and initial mail

This commit is contained in:
JamDog 2010-12-06 18:40:28 +00:00
parent d257dc0c75
commit e068bfd5c0
28 changed files with 4085 additions and 588 deletions

View file

@ -1516,3 +1516,24 @@ bool set_admin_level(struct char_data *ch, int admlvl)
return TRUE;
}
/* add_commas takes a numeric value, and adds commas to it, returning a string */
char *add_commas(long num)
{
int i, j = 0, len;
int negative = (num < 0);
char num_string[MAX_INPUT_LENGTH];
static char commastring[MAX_INPUT_LENGTH];
sprintf(num_string, "%ld", num);
len = strlen(num_string);
for (i = 0; num_string[i]; i++) {
if ((len - i) % 3 == 0 && i && i - negative)
commastring[j++] = ',';
commastring[j++] = num_string[i];
}
commastring[j] = '\0';
return commastring;
}