[I7] Comma Separator

Does I7 have a way of displaying numbers with the Comma Separator? e.g. 1,000

No, not built-in, and I don’t see an extension that mentions it. I could whip one together real fast.

To say (N - number) with commas: (- print (NumberCommas) say__n=({N}); -)

Include (-
Array NumCommaBuffer -> 10;

[ NumberCommas val
	pos ix;
	if (val == 0) {
		print (char) '0';
		return;
	}
	if (val < 0) {
		print (char) '-';
		val = -val;
	}
	pos = 0;
	while (val) {
		NumCommaBuffer->pos = '0' + (val % 10);
		val = val / 10;
		pos++;
	}
	for (ix=pos-1 : ix >= 0 : ix-- ) {
		print (char) NumCommaBuffer->ix;
		if (ix % 3 == 0 && ix > 0)
			print (char) ',';
	}
];

-).

This chokes on -MAXINT-1. I should special-case -32768 in Z-code, but I haven’t.

Excellent and such a quick turn around, wish my coding came as fast! Thanks for the help.